結果

問題 No.18 うーさー暗号
ユーザー Yang33
提出日時 2015-12-27 21:38:16
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 07:31:44
合計ジャッジ時間 832 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         fgets(mo, 1024, stdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>

int main(void)
{
	int i, len;
	char mo[1024];

	fgets(mo, 1024, stdin);
	len = strlen(mo);
	for (i = 0; i < len; i++) {//len回
		mo[i] = mo[i] + 26 - (i+1) % 26;
		if(mo[i]>'Z')
		{
			mo[i] = mo[i] -26;
		}
	}
	mo[len-1] = '\0';
	printf("%s\n",mo);

	return 0;
}
0