結果

問題 No.536 人工知能
コンテスト
ユーザー Haijinn
提出日時 2017-07-04 23:16:11
言語 C11(gcc12 gnu拡張)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=gnu11 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 1,000 ms
+ 665µs
コード長 444 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 58 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-28 01:41:48
合計ジャッジ時間 1,128 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 | scanf("%s",s);
      | ^~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include<string.h>
int main(){
char s[11];
int x=0;
int i;
int c=0;
char q[2];
scanf("%s",s);
x=strlen(s);
//printf("%d\n",x);
//printf("!\n");
i=x-2;
if(s[i]=='a'&&s[i+1]=='i'){
	c=1;
	
}

//printf("%d\n",c);
if(c==1){
	//printf("!\n");

	for(i=0;i<x-2;i++){
		printf("%c",s[i]);
		
		
		
		
		
		
		
	}
	printf("AI\n");
	
	
}else if(c==0){
	
	printf("%s-AI\n",s);
	
	
}

	return 0;
	
}
0