输入句英文,将所有字母变成大写后输出,我下面错哪里了,求解答
#include<stdio.h>main()
{
int i,j;
charch;
while((ch=getchar())!='\n')
{scanf("%c",&ch);
if(ch>'a' && ch<'z')
ch=ch+32;
printf("%c",ch);
}
}
#include<stdio.h>
int main(void)
{
//int i,j;
int ch;
while((ch=getchar())!='\n')
{//scanf("%c",&ch);
if(ch>='a' && ch<='z')
ch=ch-32;
printf("%c",ch);
}
return 0;
} #include<stdio.h>
main()
{
charch;
while((ch=getchar())!='\n')
{
if(ch>'a' && ch<'z')
ch=ch+32;
printf("%c",ch);
}
}
页:
[1]