結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-08-12 19:39:37 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 295 bytes | 
| コンパイル時間 | 215 ms | 
| コンパイル使用メモリ | 20,608 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-18 06:59:54 | 
| 合計ジャッジ時間 | 1,586 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 5 RE * 8 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:12:3: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
   12 |   gets(str);
      |   ^~~~
      |   fgets
/usr/bin/ld: /tmp/ccJaWGNU.o: in function `main':
main.c:(.text.startup+0x26): 警告: the `gets' function is dangerous and should not be used.
            
            ソースコード
#include <stdio.h>
#define BUF 256
#define A 64
#define TYPE 26
int main(int argc, char const* argv[])
{
  char str[BUF];
  int k;
  gets(str);
  for ( k = 1; str[k-1] != '\0'; k++ )
  {
    str[k-1] -= k % TYPE;
    if ( str[k-1] <= A ) { str[k-1] += TYPE; }
  }
  puts(str);
  return 0;
}
            
            
            
        