题意:将字符串中的小写字母转化为大写即可。
这里介绍一个字符串函数—— toupper()。对于一个字母 ,若它有对应的大写字母,该函数就将其转换为大写字母,否则保持不变。
#include<bits/stdc++.h>
#include<cstring>
#include<cstdio>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=0;i<s.length();i++){
if(islower(s[i]))s[i]-=32;
}
cout<<s<<endl;
return 0;
}