結果

問題 No.536 人工知能
ユーザー samplelpmassamplelpmas
提出日時 2017-07-01 14:25:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 172 ms / 1,000 ms
コード長 512 bytes
コンパイル時間 3,709 ms
コンパイル使用メモリ 77,920 KB
実行使用メモリ 54,484 KB
最終ジャッジ日時 2024-04-15 10:00:22
合計ジャッジ時間 6,263 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
54,484 KB
testcase_01 AC 171 ms
54,216 KB
testcase_02 AC 170 ms
54,440 KB
testcase_03 AC 158 ms
54,172 KB
testcase_04 AC 161 ms
54,184 KB
testcase_05 AC 172 ms
54,172 KB
testcase_06 AC 153 ms
53,796 KB
testcase_07 AC 159 ms
54,100 KB
testcase_08 AC 167 ms
54,204 KB
testcase_09 AC 165 ms
53,804 KB
testcase_10 AC 155 ms
54,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String ID = sc.next();

        int len = ID.length();

        if ((ID.charAt(len - 2) == 'a') && (ID.charAt(len - 1) == 'i')) {

            for (int i = 0; i < len - 2; i++) {
                System.out.print(ID.charAt(i));
            }

            System.out.println("AI");

        } else {

            System.out.println(ID + "-AI");

        }

    }

}
0