0$房天下问答|C语言 从键盘上输入三个小写字母转换为对应的大写字母输出$https://m.fang.com/ask/ask_1555320.html$https://static.soufunimg.com/common_m/m_public/201511/images/asksharedefault.png
packc/pages/ask/detail/detail?askid=1555320
-
C语言 从键盘上输入三个小写字母转换为对应的大写字母输出
更多
共1个回答
-
-
-
KANGTA1998
丨Lv 4
/*21chenxb's work2010-6-15VC++6.0*/#include <stdio.h>int main(){ char s[3]; for (int i=0;i<3;i++) { scanf("%c",&s[i]); if (s[i]>'z'||s[i]<'a') { printf("你输入的有非小写字符,程序将不做处理!"); } else { s[i]-=32; } } for (int j=0;j<3;j++) { printf("%c",s[j]); } printf("\n"); return 0;}
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。

关注成功