输入一个字符,如果是小写字母则将其转换为大写字母输出,否则照原样输出.

2025-03-29 08:01:04
推荐回答(1个)
回答1:

//#include "stdafx.h"//vc++6.0加上这一行.
#include "stdio.h"
#include "ctype.h"
void main(void){
char ch;
while(1){
if((ch=getchar())=='\n')
break;
if(isalpha(ch))
ch^=0x20;
printf("%c\n",ch);
fflush(stdin);
}
}