結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー htensai
提出日時 2019-11-14 08:24:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 422 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 74,544 KB
実行使用メモリ 41,392 KB
最終ジャッジ日時 2024-09-21 21:20:17
合計ジャッジ時間 7,263 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int total = 0;
		for (int i = 0; i < 5; i++) {
		    int x = sc.nextInt();
		    if (x % 15 == 0) {
		        total += 8;
		    } else if (x % 5 == 0 || x % 3 == 0) {
		        total += 4;
		    } else {
		        total += String.valueOf(x).length();
		    }
		}
		System.out.println(total);
	}
}
0