結果

問題 No.536 人工知能
ユーザー dai11dai11
提出日時 2017-07-04 13:47:43
言語 C++11
(gcc 11.4.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 421 bytes
コンパイル時間 1,394 ms
コンパイル使用メモリ 157,304 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 15:52:18
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 RE -
testcase_08 AC 2 ms
5,376 KB
testcase_09 RE -
testcase_10 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%s",S); //入力
      |         ~~~~~^~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char **argv) 
{
	char S[11]; //作成者ID
	int i; //文字列の数字変換した値を保管
	scanf("%s",S); //入力
	
	i=strlen(S); //入力した文字を数字
	
	if(('a' == S[i-2]) && ('i' == S[i-1])) //配列の末尾が[ai]の時
	  {
		  S[i-2] = 'A';
		  S[i-1] = 'I';
	  }
	else
	  {
		  strcat(S,"-AI");
	  }
	printf("%s\n",S);
	return 0;
}
0