注意字符串中的常用函数:toupper,和tolower,将字符转化为大小写。
to_string将int转化为string类型。
#include <bits/stdc++.h> #define int long long //(有超时风险) #define PII pair<int,int> #define endl '\n' #define LL __int128 using namespace std; const int N=2e5+10,M=1e3+10,mod=998244353,INF=0x3f3f3f3f; int a[N],b[N],c[N],pre[N]; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); string s;cin>>s; for(int i=0;i<s.size();i++) s[i]= toupper(s[i]); cout<<s<<endl; return 0; }