結果

問題 No.536 人工知能
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-12 07:40:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 315 bytes
コンパイル時間 2,268 ms
コンパイル使用メモリ 76,480 KB
実行使用メモリ 41,504 KB
最終ジャッジ日時 2024-04-28 16:50:42
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,084 KB
testcase_01 AC 115 ms
40,284 KB
testcase_02 AC 128 ms
41,176 KB
testcase_03 AC 130 ms
41,288 KB
testcase_04 AC 130 ms
41,180 KB
testcase_05 AC 130 ms
41,504 KB
testcase_06 AC 132 ms
41,416 KB
testcase_07 AC 131 ms
41,436 KB
testcase_08 AC 128 ms
41,416 KB
testcase_09 AC 128 ms
41,052 KB
testcase_10 AC 131 ms
41,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		if(s.substring(n - 2, n).equals("ai")) {
			s = s.substring(0, n - 2) + "AI";
		} else {
			s += "-AI";
		}
		System.out.println(s);
	}
}
0