#include #include using namespace std;

string convertToUpperCase(string s) { for(int i=0; i<s.length(); i++) { if(s[i] >= 'a' && s[i] <= 'z') { s[i] = s[i] - 'a' + 'A'; } } return s; }

int main() { string s; cin >> s; cout << convertToUpperCase(s) << endl; return 0; }

c++开启计算机需要飞船名和密码飞船名是一个仅由大小写英文字母构成的字符串s计算机提示把s中的所有小写字母都转换为大写字母后就是密码。请你编写程序计算出密码。输入 一个只包含大小写英文字母的字符串s长度不超过100。输出 一个字符串为将字符串s中的所有小写字母转换为大写字母后的字符串。输入样例 MonaLisa输出样例 MONALISA用时内存 1000MS100MB提示 字符串s的长度可以表示为

原文地址: https://www.cveoy.top/t/topic/ieZR 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录