#include #include using namespace std;

int main() { string str; cin >> str;

for (int i = 0; i < str.length(); i++) {
    if (str[i] >= 'a' && str[i] <= 'z') {
        str[i] = toupper(str[i]);
    } else if (str[i] >= 'A' && str[i] <= 'Z') {
        str[i] = tolower(str[i]);
    }
}

cout << str << endl;

return 0;

}

C++ 字符串大小写转换算法详解

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

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