Statistical vowels
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 46701 Accepted Submission (s): 19038
Problem description counts the number of occurrences of each vowel in a string.
Input data first consists of an integer n, which represents the number of test instances, followed by a string of n lines with a length of not more than 100.
Output outputs 5 rows for each test instance, in the following format:
A:num1
E:num2
I:num3
O:num4
U:num5
Multiple test instances are separated by a blank line.
Please pay special attention: There is no blank line after the last output:)
Sample Input2 Aeiou My name is Ignatius
Sample outputa:1 e:1 i:1 o:1 u:1 a:2 e:1 i:3 o:0 u:1
Authorlcy
SOURCEC Language programming Exercises (iv)
Recommendlcy | We have carefully selected several similar problems for you:1062 1256 1020 1075 2072
1#include <stdio.h>2#include <string.h>3 intMain ()4 {5 Charstr[ the] ;6 inti, N;7 while(~SCANF ("%d", &N))8 {9GetChar ();//Why do you have to put it here? Ten while(n--) One { A gets (str); - intLen =strlen (str); - intA=0, b=0, c=0, d=0, e=0 ; the for(i=0; i<len; i++) - { - if(Str[i] = ='a') -a++ ; + if(Str[i] = ='e') -b++ ; + if(Str[i] = ='I') AC++ ; at if(Str[i] = ='o') -d++ ; - if(Str[i] = ='u') -e++ ; - } -printf"a:%d\n", a); inprintf"e:%d\n", b); -printf"i:%d\n", c); toprintf"o:%d\n", d); +printf"u:%d\n", e); - if(n!=0) theprintf"\ n") ; * } $ }Panax Notoginseng return 0 ; -}
Hangzhou Electric 2027--Statistical vowel