結果

問題 No.311 z in FizzBuzzString
ユーザー UEUEUE66UEUEUE66
提出日時 2018-11-13 15:46:54
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 507 bytes
コンパイル時間 2,266 ms
コンパイル使用メモリ 77,428 KB
実行使用メモリ 57,832 KB
最終ジャッジ日時 2023-10-25 02:56:26
合計ジャッジ時間 4,108 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,364 KB
testcase_01 AC 129 ms
57,232 KB
testcase_02 AC 126 ms
57,660 KB
testcase_03 AC 124 ms
57,244 KB
testcase_04 AC 129 ms
57,620 KB
testcase_05 AC 131 ms
57,324 KB
testcase_06 AC 131 ms
57,456 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package com.company;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	// write your code here
        Scanner s = new Scanner(System.in);
        int count = 0;
        int N = s.nextInt();
        for (int i = 1; i < N + 1; i++) {
            if (i % 3 == 0 && i % 5 == 0) {
                count = count + 4;
            } else if (i % 3 == 0 || i % 5 == 0) {
                count = count + 2;
            }
        }
        System.out.println(count);
    }
}
0