結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  AQUA16573837 | 
| 提出日時 | 2018-04-03 19:14:42 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 380 bytes | 
| コンパイル時間 | 223 ms | 
| コンパイル使用メモリ | 36,560 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-26 08:33:34 | 
| 合計ジャッジ時間 | 878 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 | 
コンパイルメッセージ
main.cpp: In function ‘void solve()’:
main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;
void solve();
int main() {
	solve();
#ifdef DBG
	while (true);
#endif
}
//18
void solve() {
	char s[1025];
	scanf("%s", s);
	for (int i = 0, c = 1; s[i] != 0; i++, c++) {
		int v = ((int) (s[i] - 'A') - c) % 26;
		if (v < 0)
			v += 26;
		s[i] = v + 'A';
	}
	printf("%s\n", s);
}
            
            
            
        