大神们能不能帮忙看看哪错了,为毛运行会一直循环,该怎么改
#include <stdio.h>int main(){char ch;ch=getchar();while(ch!=' '){if((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z')) {if((ch>='W'&&ch<='Z')||(ch>='w'&&ch<='z')){ch=ch-22; }else{ch=ch+4; }}printf("%c",ch);continue; }return 0; }
程序的主要问题是没有重新读入字符,当然是死循环了,以下是改好的(包括其它错)
热门标签: