結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
Yang33
|
| 提出日時 | 2015-12-27 21:39:32 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 71 ms |
| コンパイル使用メモリ | 21,832 KB |
| 最終ジャッジ日時 | 2026-01-16 03:11:51 |
| 合計ジャッジ時間 | 543 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:36: error: C++ style comments are not allowed in ISO C90
11 | for (i = 0; i < len; i++) {//len回
| ^
main.c:11:36: note: (this will be reported only once per input file)
main.c:9:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | fgets(mo, 1026, stdin);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void)
{
int i, len;
char mo[1026];
fgets(mo, 1026, 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;
}
Yang33