結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  dgd1724 | 
| 提出日時 | 2016-09-07 18:54:05 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 569 bytes | 
| コンパイル時間 | 521 ms | 
| コンパイル使用メモリ | 67,112 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-07 06:15:54 | 
| 合計ジャッジ時間 | 1,117 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <cmath>
#include <fstream>
int main(void) {
	//test用
	//std::ifstream in("test.txt");
	//std::cin.rdbuf(in.rdbuf());
	std::string str;
	std::cin >> str;
	for (int i = 0; i < str.length(); i++) {
		int temp = str[i] - (i + 1);
		if (temp >= 65) {
			str[i] = temp;
		}
		else {
			temp = std::abs(65 - temp) % 26;
			if (temp != 0) {
				str[i] = 90 - temp + 1;
			}
			else {
				str[i] = 65;
			}
		}
	}
	std::cout << str << std::endl;
}
            
            
            
        