C语言入门题库——小写字母转换
Description:输入一个小写字母,将小写转换为大写。
Input:输入一个小写字母字符。
Output:分别输出转换前后的字母字符及其对应的ASCII码值。
Sample Input:b
Sample Output:
b,B
98,66
//小写字母转换
#include<stdio.h>
int main()
{
char x, y;
scanf("%c", &x);
if(x >= 'a' && x <= 'z')
y = x - 32;
printf("%c,%c\n%d,%d", x, y, x, y);
return 0;
}