自由尋覓快樂別人從沒法感受

0%

C语言第三章T5

题目:输入字符,并以按Enter键结束。将其中的小写字母转换成大写字母,而其他字符不变。

主要代码:

1
2
3
4
5
6
7
8
9
10
11
12
# include <stdio.h>
# include <string.h>
int main ( )
{
char a;
while ( ( a=getchar() ) != '\n')
{
putchar(a-32);
}
printf("\n");
return 0;
}

运行结果: