結果

問題 No.18 うーさー暗号
ユーザー mkanmkan
提出日時 2017-02-10 14:00:13
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 71,976 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 06:25:03
合計ジャッジ時間 949 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <map>
#include <cstdio>
#include <cmath>
using namespace std;

int main() {
	string s;
	cin >> s;
	for (int i = 1; i <= s.size(); i++) {
		int a = int(s[i - 1]) - 65;
		for (int j = 0; j < i; j ++ ) {
		if (a == 0)a = 25;
		else a--;
	}
		//cout << a << endl;
		cout << char(a + 65);
	}
	cout << endl;
	return 0;
}
0