結果

問題 No.163 cAPSlOCK
ユーザー Vertigo
提出日時 2024-11-13 18:36:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 68,336 KB
最終ジャッジ日時 2025-02-25 04:06:16
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

string f(const string& a){
    string res;
      for (char c : a) {
            if (islower(c)) {
                res += toupper(c);
            } else if (isupper(c)) {
                res += tolower(c);
            } else {
                res += c;
            }
        }
        return res;
    }

int main(){
    string s;
    cin >> s;
    cout << f(s) << endl;
}
0