結果
| 問題 |
No.536 人工知能
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-01 00:31:50 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 701 bytes |
| コンパイル時間 | 1,034 ms |
| コンパイル使用メモリ | 29,184 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 05:42:34 |
| 合計ジャッジ時間 | 869 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
コンパイルメッセージ
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/ccg97D79.o: in function `main':
main.c:(.text.startup+0x10): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#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;
}