結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー fabled2468fabled2468
提出日時 2018-09-27 23:32:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 837 bytes
コンパイル時間 2,803 ms
コンパイル使用メモリ 74,712 KB
実行使用メモリ 54,588 KB
最終ジャッジ日時 2024-04-20 09:14:43
合計ジャッジ時間 7,294 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
52,348 KB
testcase_01 AC 114 ms
53,912 KB
testcase_02 AC 113 ms
54,152 KB
testcase_03 AC 103 ms
53,144 KB
testcase_04 AC 112 ms
53,904 KB
testcase_05 AC 114 ms
54,256 KB
testcase_06 AC 113 ms
54,144 KB
testcase_07 AC 96 ms
52,680 KB
testcase_08 AC 112 ms
54,088 KB
testcase_09 AC 114 ms
54,588 KB
testcase_10 AC 110 ms
53,836 KB
testcase_11 AC 117 ms
54,032 KB
testcase_12 AC 101 ms
52,956 KB
testcase_13 AC 110 ms
54,176 KB
testcase_14 AC 120 ms
53,976 KB
testcase_15 AC 113 ms
54,000 KB
testcase_16 AC 113 ms
54,236 KB
testcase_17 AC 102 ms
52,936 KB
testcase_18 AC 101 ms
53,152 KB
testcase_19 AC 110 ms
54,076 KB
testcase_20 AC 103 ms
52,904 KB
testcase_21 AC 106 ms
53,116 KB
testcase_22 AC 114 ms
53,788 KB
testcase_23 AC 111 ms
54,028 KB
testcase_24 AC 101 ms
52,940 KB
testcase_25 AC 104 ms
53,236 KB
testcase_26 AC 111 ms
53,964 KB
testcase_27 AC 112 ms
54,104 KB
testcase_28 AC 109 ms
53,952 KB
testcase_29 AC 105 ms
54,272 KB
testcase_30 AC 104 ms
53,096 KB
testcase_31 AC 118 ms
53,996 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