当前位置:网站首页>Daily calculation (vowel case conversion)

Daily calculation (vowel case conversion)

2022-06-24 23:45:00 Dawa big baby

subject

Title Description
solo I have been very interested in English letters since I was a child , Especially vowels (a,e,i,o,u,A,E,I,O,U), When he writes his diary, he always writes vowels in uppercase , Consonants are written in lowercase , Although others look awkward , however solo But very skilled . Try translating a sentence into solo The habit of keeping a diary .

Answer the request
The time limit :1000ms, Memory limit :100MB
Input
Enter a string S( Length not exceeding 100, Contains only uppercase and lowercase letters and spaces ).

Output
according to solo The habit of keeping a diary outputs the translated string S.

Examples
sample input 1
Who Love Solo
sample output 1
whO lOvE sOlO

Their thinking

direct Java Replace reason letter .

public class Main {
    public static void main(String[] args) {       
        Scanner scanner = new Scanner(System.in);
        String result = scanner.nextLine().toLowerCase().replace('a','A').replace('e','E')
            .replace('i','I').replace('o','O').replace('u','U');
        System.out.println(result);
    }
}
原网站

版权声明
本文为[Dawa big baby]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211102015966.html