Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
31621 | 惠子铭 | 将字符串中的小写字母转换成大写字母 | C++ | Accepted | 0 MS | 256 KB | 344 | 2023-11-19 20:06:15 |
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { char a[256]; int len; int i; gets(a); len=strlen(a);//计算字符串长度 for(i=0; i<len; i++) //小写转换为大写 if(a[i]>='a'&&a[i]<='z') a[i]-=32; cout<<a; return 0; }