编写一个程序,完成字符大小写的转换。

来源:互联网 发布:赚话费的软件 编辑:程序博客网 时间:2024/06/17 00:12

随机输入大写字母,程序输出小写字母或者随机输入小写字母,程序输出大写字母

调用toupper()函数 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> void toupper(char ch) {  if (ch >= 'a'&&ch <= 'z')  {   printf("%c\n", ch - 32);  }  else  {   printf("%c\n", ch + 32);  } } int main() {  char ch;  scanf("%c", &ch);  toupper(ch);  system("pause");  return 0; }
阅读全文
0 0
原创粉丝点击