hdu3079 Vowel Counting (strlwr(将字符串中的字母转换为小写);strupr(转换为大写))
点击打开链接
题目意思:将元音字母转换为大写,其他为小写
string:strlwr(将字符串中的字母转换为小写);strupr(转换为大写)
#include<stdio.h>#include<string.h>int main(){ int t,i;char str[55];scanf("%d",&t);getchar();while(t--){gets(str);strlwr(str);//strlwr将字符串中的字母转换为小写;strupr是转换为大写for(i=0;str[i];i++)if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')str[i]-=32;puts(str);}return 0;}