C语言从键盘上输入5个小写字母abcde,将他们转换成相应的大写字母后输出
#include<stdio.h>intmain(void){charch1,ch2,ch3,ch4,ch5;scanf("%c%c%c%c%c\n",&ch1,&ch2...
#include<stdio.h>
int main(void)
{
char ch1,ch2,ch3,ch4,ch5;
scanf("%c%c%c%c%c\n",&ch1,&ch2,&ch3,&ch4,&ch5);
ch1=ch1-32;
ch2=ch2-32;
ch3=ch3-32;
ch4=ch4-32;
ch5=ch5-32;
printf("a=%c,b=%c,c=%c,d=%c,e=%c\n",ch1,ch2,ch3,ch4,ch5);
return 0;
}
求大神指教,我输入a b c d e出来的
怎么回事 展开
int main(void)
{
char ch1,ch2,ch3,ch4,ch5;
scanf("%c%c%c%c%c\n",&ch1,&ch2,&ch3,&ch4,&ch5);
ch1=ch1-32;
ch2=ch2-32;
ch3=ch3-32;
ch4=ch4-32;
ch5=ch5-32;
printf("a=%c,b=%c,c=%c,d=%c,e=%c\n",ch1,ch2,ch3,ch4,ch5);
return 0;
}
求大神指教,我输入a b c d e出来的
怎么回事 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询