C语言输入一个小写字母要求输出一个大写字母。

2025-03-14 23:21:33

#include<stdio.h>

int main()

{

int one;

int two;

printf("please enter one char:\n");

one = getchar();

two = one - 32;

putchar(two);

printf("%c\n",two);

putchar('\n');

return 0;

}

C语言输入一个小写字母要求输出一个大写字母。

扩展资料

输入一个小写字母输出一个对应的大写字母

#include<stdio.h>

int main()

{

char a,b;

scanf("%c",&a);

b=a+32;

printf("%c",b);

return 0;

}

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢