結果

問題 No.536 人工知能
コンテスト
ユーザー kasumiko
提出日時 2017-08-01 00:31:50
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 701 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 104 ms
コンパイル使用メモリ 31,068 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 16:12:45
合計ジャッジ時間 587 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:29:3: warning: ‘gets’ is deprecated [-Wdeprecated-declarations]
   29 |   gets(s);
      |   ^~~~
In file included from /usr/include/stdio.h:970,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:292:1: note: declared here
  292 | gets (__fortify_clang_overload_arg (char *, , __str))
      | ^~~~
main.c:29:3: warning: ignoring return value of ‘gets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   29 |   gets(s);
      |   ^~~~~~~
/usr/bin/ld: /tmp/cc2Adwj9.o: in function `main':
main.c:(.text.startup+0x27): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include <stdbool.h>

typedef double db;
typedef int in;
typedef long int li;
typedef long long int lli;
typedef long ld;
typedef long lld;

#define pi M_PI
#define in scanf
#define out printf
#define inf INT_MAX
#define rep(i,n) for(int i=0;i<n;++i)
#define debugd(d) printf("%d\n",d)
#define debugs(s) printf("%s\n",s)
#define debugc(c) printf("%c\n",c)
#define debugf(f) printf("%f\n",f)


int main (void)
{
  char s[11];
  gets(s);
  int slen=strlen(s);
  if(s[slen-2]=='a'&&s[slen-1]=='i')
  {
    s[slen-2]='A';
    s[slen-1]='I';
    puts(s);
  }
  else
  {
    out("%s-AI\n",s);
  }
  return 0;
}
0