結果

問題 No.18 うーさー暗号
ユーザー Lavender
提出日時 2019-08-30 19:57:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 166,148 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 18:39:37
合計ジャッジ時間 2,032 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
    string s;
    char c;
    int n;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        c = s[i];
        n = i;
        while (n >= 0) {
            c--;
            if (c == 'A'-1) {
                c = 'Z';
            }
            n--;
        }
        s[i] = c;
    }
    cout << s << endl;
    return 0;
}
0