結果

問題 No.536 人工知能
ユーザー tentententen
提出日時 2020-11-12 08:36:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 473 bytes
コンパイル時間 2,347 ms
コンパイル使用メモリ 73,336 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2023-09-30 01:04:46
合計ジャッジ時間 4,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,376 KB
testcase_01 AC 128 ms
56,024 KB
testcase_02 AC 128 ms
55,672 KB
testcase_03 AC 123 ms
55,860 KB
testcase_04 AC 122 ms
55,640 KB
testcase_05 AC 127 ms
55,552 KB
testcase_06 AC 123 ms
55,668 KB
testcase_07 AC 129 ms
56,048 KB
testcase_08 AC 125 ms
55,408 KB
testcase_09 AC 130 ms
55,740 KB
testcase_10 AC 128 ms
56,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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