#120: ...


s201 (蔡炘成)

學校 : 不指定學校
編號 : 236
來源 : [124.218.136.197]
最後登入時間 :
2026-02-04 00:20:30
t033. 403 字串與檔案處理 (字串大小寫轉換) | From: [118.163.232.198] | 發表日期 : 2026-01-31 15:18

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. string str;
  4. int len ;
  5. int main()
  6. {

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1.     cin>>str;
  2.     len=str.size();
  3.     for(int i=0;i<len;i++)
  4.     {
  5.         int c=int(str[i]);
  6.         if(c>='A' && c<='Z')
  7.             c+=32;
  8.         else
  9.             c-=32;
  10.         cout<<char(c);
  11.     }
  12.     return 0;
  13. }
 
ZeroJudge Forum