結果
| 問題 | No.536 人工知能 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-07-04 13:47:43 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                RE
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 421 bytes | 
| コンパイル時間 | 1,284 ms | 
| コンパイル使用メモリ | 158,664 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-05 15:12:42 | 
| 合計ジャッジ時間 | 2,501 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 7 RE * 4 | 
コンパイルメッセージ
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); //入力
      |         ~~~~~^~~~~~~~
            
            ソースコード
#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;
}
            
            
            
        