結果

問題 No.536 人工知能
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-10 21:30:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 429 bytes
コンパイル時間 2,481 ms
コンパイル使用メモリ 82,924 KB
実行使用メモリ 54,268 KB
最終ジャッジ日時 2024-04-24 01:27:07
合計ジャッジ時間 4,351 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
54,268 KB
testcase_01 AC 136 ms
54,108 KB
testcase_02 AC 134 ms
54,044 KB
testcase_03 AC 131 ms
54,020 KB
testcase_04 AC 131 ms
54,068 KB
testcase_05 AC 128 ms
54,108 KB
testcase_06 AC 129 ms
54,184 KB
testcase_07 AC 132 ms
54,008 KB
testcase_08 AC 132 ms
54,012 KB
testcase_09 AC 133 ms
53,960 KB
testcase_10 AC 131 ms
53,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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