题目内容:
编写程序,把键盘输入的字符串中的小写字母转换为大写字母。
输入格式:
gets
输出格式:
"%s"
输入样例:
aAB23edf
输出样例:
AAB23EDF
时间限制:500ms内存限制:32000kb
#include <stdio.h>
#include<ctype.h>
int main(){
char str1[50];int i=0;
gets(str1);
while(str1[i]!='\0'){
if(!(isupper(str1[i]))){
str1[i]=toupper(str1[i]);
}
i++;
}
puts(str1);
return 0;
}