結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー UEUEUE66
提出日時 2018-11-13 15:14:10
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 2,605 ms
コンパイル使用メモリ 73,864 KB
実行使用メモリ 41,568 KB
最終ジャッジ日時 2024-12-24 13:14:42
合計ジャッジ時間 8,764 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

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;
        while (s.hasNext()) {
            int n = s.nextInt();
            if (n % 3 == 0 && n % 5 == 0) {
                count = count + 8;
            } else if (n % 3 == 0 || n % 5 == 0) {
                count = count + 4;
            } else {
                count = count + 1;
            }
        }
        System.out.println(count);
    }
}
0