1095:大小写转换
Description
读入一些字符串,将其中的小写字母转成大写字母(其他字符不变)。
Input
输入为多行,每行为一个字符串,字符串只由字母和数字组成,长度不超过80。输入以“End of file”结束。
Output
对于每行输入,输出转换后的字符串。
Sample Input
HelloICPC200412345abcde
Sample Output
HELLO
ICPC2004
12345ABCDE
#include<stdio.h>
#include<string.h>
int main()
{
char a[10000];
int i,n;
while(gets(a))
{
n=strlen(a);
for(i=0;i<n;i++)
{
if(a[i]>=97)
a[i]=a[i]-32;
printf("%c",a[i]);
}
printf("\n");
}
return 0;
}