#include<stdio.h>
int main()
{
ch = getchar();
if ((ch>='A')&&(ch<='Z');
printf("%d\n",ch);
else
ch=ch-32;
printf("%d\n",ch);
return 0;
}
错在哪里了,求解答
#include<stdio.h>
int main()
{
ch = getchar();
if ((ch>='A')&&(ch<='Z');
printf("%d\n",ch);
else
ch=ch-32;
printf("%d\n",ch);
return 0;
}
错在哪里了,求解答
if语句后面的分号删掉
else要加大括号,将下面两行括起来
#include<stdio.h>
int main()
{
ch = getchar();
if ((ch>='A')&&(ch<='Z'))
printf("%c\n",ch);
else if(ch>='a' && ch<='z')
{
ch=ch-32;
printf("%c\n",ch);
}
return 0;
}