結果

問題 No.536 人工知能
ユーザー face4face4
提出日時 2018-04-21 18:27:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 375 bytes
コンパイル時間 2,025 ms
コンパイル使用メモリ 71,300 KB
実行使用メモリ 56,116 KB
最終ジャッジ日時 2023-09-09 12:21:32
合計ジャッジ時間 4,012 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,752 KB
testcase_01 AC 118 ms
56,028 KB
testcase_02 AC 120 ms
55,908 KB
testcase_03 AC 120 ms
55,560 KB
testcase_04 AC 119 ms
55,832 KB
testcase_05 AC 117 ms
56,116 KB
testcase_06 AC 117 ms
56,060 KB
testcase_07 AC 116 ms
55,640 KB
testcase_08 AC 117 ms
55,744 KB
testcase_09 AC 117 ms
55,656 KB
testcase_10 AC 120 ms
55,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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