慈善题
题目描述
大家都知道一些办公软件有自动将字母转换为大写的功能。输入一个长度不超过 100 且不包括空格的字符串。要求将该字符串中的所有小写字母变成大写字母并输出。
输入格式
无
输出格式
无
输入输出样例
输入
Luogu4!
输出
LUOGU4!
#include<bits/stdc++.h>
using namespace std;
void mytoupper(char *s);
int main(){
char word[101]={'\0'};
gets(word);
mytoupper(word);
cout<<word;
}
void mytoupper(char *s){
int len=strlen(s);
for(int i=0;i<len;i++){
if(s[i]>='a'&&s[i]<='z'){
s[i]-=32;
}
}
}