結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  piniky | 
| 提出日時 | 2015-09-02 15:46:26 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 381 bytes | 
| コンパイル時間 | 93 ms | 
| コンパイル使用メモリ | 22,400 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-18 17:51:00 | 
| 合計ジャッジ時間 | 576 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 WA * 9 | 
コンパイルメッセージ
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 - i) % 26 + 65;
	}
	
	
	printf("%s", newS);
	return 0;
}
            
            
            
        