Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cctype>
- #include <iostream>
- #include <sstream>
- #include <string>
- using namespace std;
- string uppercase(string& s) {
- stringstream out;
- for (auto& e : s)
- out << static_cast<char>(toupper(e));
- return out.str();
- }
- int main() {
- string s;
- cout << "文字列? ";
- getline(cin, s);
- cout << uppercase(s) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement