文章
40
粉丝
607
获赞
68
访问
418.3k
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main() {
string s;
int a[5] = { 0 };
getline(cin,s);
for (int i = 0;i < s.size();i++) {
if (s[i] == 'a') {
a[0]++;
}
else if (s[i] == 'e') {
a[1]++;
}
else if (s[i] == 'i') {
a[2]++;
}
else if (s[i] == 'o') {
a[3]++;
}
else if (s[i] == 'u') {
a[4]++;
}
}
cout << "a " << a[0] << endl;
cout << "e " << a[1] << endl;
cout << "i " << a[2] << endl;
cout << "o " << a[3] << endl;
cout << "u " << a[4] << endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发