結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー UEUEUE66
提出日時 2018-11-13 15:39:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 709 bytes
コンパイル時間 1,872 ms
コンパイル使用メモリ 73,684 KB
実行使用メモリ 41,728 KB
最終ジャッジ日時 2024-12-24 13:14:54
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 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;
        for (int i = 0; i < 5; i++) {
            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 {
                int loop = 1;
                while (n >= 10) {
                    n = n / 10;
                    loop++;
                }
                count = count + loop;
            }
        }
        System.out.println(count);
    }
}
0