結果

問題 No.536 人工知能
ユーザー 37zigen37zigen
提出日時 2020-01-23 04:47:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 2,118 ms
コンパイル使用メモリ 71,500 KB
実行使用メモリ 55,764 KB
最終ジャッジ日時 2023-09-25 09:17:56
合計ジャッジ時間 4,380 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,412 KB
testcase_01 AC 118 ms
55,724 KB
testcase_02 AC 120 ms
55,600 KB
testcase_03 AC 119 ms
55,448 KB
testcase_04 AC 120 ms
55,604 KB
testcase_05 AC 123 ms
55,684 KB
testcase_06 AC 119 ms
55,764 KB
testcase_07 AC 119 ms
55,412 KB
testcase_08 AC 118 ms
55,684 KB
testcase_09 AC 120 ms
55,704 KB
testcase_10 AC 120 ms
55,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

class Main{
	public static void main(String[] args){
		new Main().run();
	}
	
	void run(){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int n=s.length();
		String tail="";
		if(c[n-2]=='a'&&c[n-1]=='i'){
			c[n-2]='A';c[n-1]='I';
		}else{
			tail="-AI";
		}
		for(int i=0;i<n;++i)System.out.print(c[i]);
		System.out.println(tail);
	}
}
0