Browse Source

大小写转换

爱玲姐姐 5 years ago
parent
commit
6cfb6ad42d
1 changed files with 13 additions and 0 deletions
  1. 13 0
      J.cpp

+ 13 - 0
J.cpp

@@ -0,0 +1,13 @@
+#include<iostream>
+#include<string>
+using namespace std;
+int main(){
+    string str;
+    while(cin >> str){
+        for(int i = 0; i < str.size(); i++){
+            if('a' <= str[i] && 'z' >= str[i]) str[i] += 'A' - 'a';
+        }
+        cout << str << endl;
+    }
+    return 0;
+}