输入一小写字母,输出对应的大写字母。
考察字符第基础和ACSLL码的知识。
小写字母比对应的大写字母的ACSLL码要大32。
所以,输入->减去32->输出,即可:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
char c;
scanf("%c",&c);
printf("%c", c-32);
return 0;
}
行。
另外,如果是大写变小写,加上32就好了。