結果
問題 |
No.18 うーさー暗号
|
ユーザー |
![]() |
提出日時 | 2017-01-09 00:05:35 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 84 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 06:23:16 |
合計ジャッジ時間 | 607 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%s", S); | ^~~~~~~~~~~~~~
ソースコード
#include <stdint.h> #include <stdio.h> #include <string.h> #define GETA ('Z' - 'A' + 1) int main(void) { char S[1024+1]; int i, len; scanf("%s", S); len = strlen(S); for (i = 0; i < len; i++) { int ofst = S[i] - 'A' - (i + 1); while (ofst < 0) ofst += GETA; putchar('A' + ofst); } putchar('\n'); return 0; }