Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
26817 唐心 元音字母转换 C++ Accepted 2 MS 732 KB 505 2022-05-24 17:03:19

Tests(1/1):


Code:

#include <iostream> #include <cstdlib> #include <cstring> using namespace std; int main() { int i,n,num,j; char str[200]; cin >>n; getchar(); for(i=0;i<n;i++) { memset(str,0,sizeof(str)); cin >>str; num = strlen(str); for(j=0;j<num;j++) { if(str[j]>='A'&&str[j]<='Z') str[j] = str[j]+32; } for(j=0;j<num;j++) { if(str[j]=='a'||str[j]=='e'||str[j]=='i'||str[j]=='o'||str[j]=='u') str[j] = str[j]-32; } cout<<str<<endl; } return 0; }