Wrong Answer
/in/foo.c: In function 'main': /in/foo.c:8:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if(ch >= 'A' && ch <= 'Z') ^~ /in/foo.c:10:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' printf("转换成小写字母是:%c\n",ch); ^~~~~~
代码
#include <stdio.h>
int main()
{
char ch;
printf("请输入一个字符:");
scanf("%c",&ch);
if(ch >= 'A' && ch <= 'Z')
ch = ch + 32;
printf("转换成小写字母是:%c\n",ch);
return 0;
}