結果

問題 No.18 うーさー暗号
ユーザー mosmos_21mosmos_21
提出日時 2016-01-21 20:18:35
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 283 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 21,324 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 13:42:34
合計ジャッジ時間 1,099 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 RE -
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 0 ms
4,348 KB
testcase_12 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%s", in);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	char in[1024] = {'\0'};
	char out[1024] = {'\0'};
	int i = 0, tmp;
	
	scanf("%s", in);
	
	while(in[i] != '\0'){
		tmp = in[i] - i - 'A' - 1;
		while(tmp < 0){ tmp += 26; }
		out[i] = 'A' + tmp % 26;
		i++;
	}
	
	printf("%s\n", out);
	return 0;
}
0