結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー fabled2468fabled2468
提出日時 2018-09-27 23:32:34
言語 Java19
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 837 bytes
コンパイル時間 3,295 ms
コンパイル使用メモリ 72,588 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-08-02 09:50:19
合計ジャッジ時間 8,854 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,784 KB
testcase_01 AC 123 ms
56,092 KB
testcase_02 AC 125 ms
55,784 KB
testcase_03 AC 124 ms
55,552 KB
testcase_04 AC 126 ms
56,040 KB
testcase_05 AC 125 ms
55,944 KB
testcase_06 AC 128 ms
55,512 KB
testcase_07 AC 127 ms
55,520 KB
testcase_08 AC 128 ms
55,940 KB
testcase_09 AC 128 ms
55,544 KB
testcase_10 AC 125 ms
55,816 KB
testcase_11 AC 124 ms
56,100 KB
testcase_12 AC 124 ms
55,488 KB
testcase_13 AC 128 ms
55,792 KB
testcase_14 AC 128 ms
55,744 KB
testcase_15 AC 127 ms
55,628 KB
testcase_16 AC 129 ms
55,848 KB
testcase_17 AC 126 ms
55,552 KB
testcase_18 AC 128 ms
55,896 KB
testcase_19 AC 128 ms
55,940 KB
testcase_20 AC 126 ms
55,724 KB
testcase_21 AC 126 ms
55,936 KB
testcase_22 AC 125 ms
55,684 KB
testcase_23 AC 125 ms
55,900 KB
testcase_24 AC 124 ms
55,980 KB
testcase_25 AC 122 ms
55,812 KB
testcase_26 AC 123 ms
55,788 KB
testcase_27 AC 123 ms
55,984 KB
testcase_28 AC 123 ms
55,784 KB
testcase_29 AC 122 ms
55,896 KB
testcase_30 AC 121 ms
56,144 KB
testcase_31 AC 121 ms
56,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No637_FizzBizz {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int[] list = new int[5];

        for (int i = 0; i < list.length; i++) {
            list[i] = scan.nextInt();
        }
        scan.close();
        int count = 0;

        for (int i = 0; i < list.length; i++) {

            int value = list[i];

            if (value % 3 == 0 && value % 5 == 0) {
                count = count + 8;
            } else if (value % 3 == 0 && value % 5 != 0) {
                count = count + 4;
            } else if (value % 3 != 0 && value % 5 == 0) {
                count = count + 4;
            } else {
                count = count + String.valueOf(value).length();
            }
        }

        System.out.println(count);
    }
}
0