結果

問題 No.536 人工知能
ユーザー kasumikokasumiko
提出日時 2017-08-01 00:31:50
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 701 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 13:19:38
合計ジャッジ時間 1,028 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 0 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:29:3: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   29 |   gets(s);
      |   ^~~~
      |   fgets
/usr/bin/ld: /tmp/ccW0knBP.o: in function `main':
main.c:(.text.startup+0x10): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #

#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