#include <iostream> #include <string> #include <algorithm> using namespace std; string str; int main() { cout << "请输入一个包含大小写字母的字符串: " << endl; cin >> str; transform(str.begin(), str.end(), str.begin(), ::tolower); cout << "转小写: " << str << endl; transform(str.begin(), str.end(), str.begin(), ::toupper); cout << "转大写: " << str << endl; system("pause"); return EXIT_SUCCESS; }