正在加载图片...
3.13程序实训【例3.4 【例34】从键盘上输入一大写英文字母,要求改用相应的小写字母输出。 /*程序名为134cpp。*/ #include "stdio. h" maino 序设计 i char cl, c2 程序运行时: scanf("%c", &cl); 输入:B<CR> printf(" The upper case is%n",cl)输出: c2=c1+a-A The upper case is B printf("The lower case is %c n", c2); The lower case is b 60 环 境 返回本节目录3.1.3 程序实训【例3.4】 《 C 语 言 程 序 设 计 》(Visual C++ .6 0 环 境 ) 返回本节目录 【例3.4】从键盘上输入一大写英文字母,要求改用相应的小写字母输出。 /*程序名为l3_4.cpp。*/ #include "stdio.h" main() { char c1,c2; scanf("%c",&c1); printf("The upper case is %c .\n",c1); c2=c1+'a'-'A'; printf("The lower case is %c .\n",c2); } 程序运行时: 输入:B<CR> 输出: The upper case is B . The lower case is b
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有