結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  piniky | 
| 提出日時 | 2015-09-02 15:47:50 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 393 bytes | 
| コンパイル時間 | 120 ms | 
| コンパイル使用メモリ | 22,784 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-07 05:47:12 | 
| 合計ジャッジ時間 | 553 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%s", S);
      |         ~~~~~^~~~~~~~~
            
            ソースコード
#define _CRT_SECURE_NO_WARNINGS
//#include <algorithm>
//#include <iostream>
//#include <string>
#include <stdio.h>
//using namespace std;
int main(){
	char S[1025], newS[1025];
	S[0] = '\0';
	scanf("%s", S);
	
	for (int i = 0; i < 1025; i++){
		if (S[i] == '\0'){ 
			newS[i] = '\0';
			break; 
		}
		newS[i] = (S[i] + 12 + 26 * 40 - i) % 26 + 65;
	}
	
	
	printf("%s\n", newS);
	return 0;
}
            
            
            
        