結果
| 問題 |
No.18 うーさー暗号
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-01-21 20:18:35 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 283 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-09-21 14:57:01 |
| 合計ジャッジ時間 | 1,110 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 RE * 1 |
コンパイルメッセージ
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);
| ^~~~~~~~~~~~~~~
ソースコード
#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;
}
mosmos_21