結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-15 23:40:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 1,000 ms
コード長 571 bytes
コンパイル時間 2,552 ms
コンパイル使用メモリ 73,516 KB
実行使用メモリ 57,764 KB
最終ジャッジ日時 2023-09-11 04:38:57
合計ジャッジ時間 8,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
56,000 KB
testcase_01 AC 135 ms
55,452 KB
testcase_02 AC 136 ms
53,592 KB
testcase_03 AC 136 ms
56,000 KB
testcase_04 AC 134 ms
55,620 KB
testcase_05 AC 136 ms
55,660 KB
testcase_06 AC 133 ms
55,860 KB
testcase_07 AC 135 ms
55,476 KB
testcase_08 AC 134 ms
55,932 KB
testcase_09 AC 135 ms
55,948 KB
testcase_10 AC 136 ms
55,788 KB
testcase_11 AC 137 ms
55,940 KB
testcase_12 AC 135 ms
55,632 KB
testcase_13 AC 136 ms
55,932 KB
testcase_14 AC 134 ms
55,792 KB
testcase_15 AC 137 ms
56,008 KB
testcase_16 AC 134 ms
55,484 KB
testcase_17 AC 136 ms
56,028 KB
testcase_18 AC 135 ms
55,844 KB
testcase_19 AC 135 ms
55,632 KB
testcase_20 AC 137 ms
55,928 KB
testcase_21 AC 135 ms
55,872 KB
testcase_22 AC 135 ms
55,804 KB
testcase_23 AC 134 ms
56,300 KB
testcase_24 AC 134 ms
55,500 KB
testcase_25 AC 134 ms
55,928 KB
testcase_26 AC 135 ms
57,764 KB
testcase_27 AC 135 ms
55,796 KB
testcase_28 AC 137 ms
55,872 KB
testcase_29 AC 135 ms
55,960 KB
testcase_30 AC 135 ms
55,928 KB
testcase_31 AC 136 ms
56,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = 0;
        String ans = "";
        for(int i = 0; i < 5; i++) {
            a = in.nextInt();
            if(a % 15 == 0) {
                ans += "FizzBuzz";
            } else if(a % 3 == 0) {
                ans += "Fizz";
            } else if(a % 5 == 0) {
                ans += "Buzz";
            } else {
                ans += String.valueOf(a);
            }
        }

        System.out.println(ans.length());
    }
}
0