結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー aaaaasatori
提出日時 2018-02-09 23:00:27
言語 Java
(openjdk 23)
結果
AC  
実行時間 120 ms / 1,000 ms
コード長 418 bytes
コンパイル時間 2,723 ms
コンパイル使用メモリ 77,700 KB
実行使用メモリ 41,764 KB
最終ジャッジ日時 2024-06-28 18:55:37
合計ジャッジ時間 7,120 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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