AC代碼(一):
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
getline( cin, s );
for(int i=0; i<s.size(); i++){
if(s[i] >= 'a' && s[i] <= 'z'){
s[i] -= 32;
}
}
cout << s <<endl;
return 0;
}
AC代碼(二):
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
getline(cin, s);
for(int i=0; i<s.length(); i++){
int temp = s[i];
if(temp>=97 && temp<=123){
printf("%c", temp-32);
}else{
printf("%c", temp);
}
}
return 0;
}