- 将字符串中的小写字母转换成大写字母
这到底有社么问题
- 2024-8-28 20:40:48 @
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
char n[101];
int main(){
gets(n);
for(int i=0;i<strlen(n);++i)
{
strupr(&n[i]);
}
cout<<n;
return 0;
}
1 comments
-
C24liudongqing LV 5 @ 2025-1-18 14:56:18Edited
同问,
#include<bits/stdc++.h> using namespace std; string a,t; int n,u; char f(char x){ if(x>='a'&&x<='z'){ x-=32; } return x; } int main(){ cin>>a; u=a.length(); for(int i=0;a[i];i++){ cout<<f(a[i]); } cout<<endl; return 0; }
- 1
Information
- ID
- 624
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 115
- Accepted
- 47
- Uploaded By