Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40940 | liusiyu | 字符大小写转换 | C++ | Accepted | 1 MS | 244 KB | 315 | 2024-02-18 11:29:44 |
#include<bits/stdc++.h> using namespace std; int main() { char a[20],b[10],c[10],cnt=0,cnt1=0; cin>>a; for(int i=0;i<strlen(a);i++){ if(a[i]>='a'&&a[i]<='z'){ a[i]-=32; } else if(a[i]>='A'&&a[i]<='Z'){ a[i]+=32; } } for(int i=0;i<strlen(a);i++){ cout<<a[i]; } return 0; }