C++ 字符串大小写转换:将所有小写字母转换为大写字母 日期: 2028-11-15 标签: 常规 #include \n#include \n#include \n\nint main() {\n std::string str; \n std::getline(std::cin, str); \n \n for (char& c : str) { \n if (std::islower(c)) { \n c = std::toupper(c); \n } \n } \n \n std::cout << str << std::endl; \n \n return 0; \n} 原文地址: https://www.cveoy.top/t/topic/nTHU 著作权归作者所有。请勿转载和采集! 免费AI点我,无需注册和登录