結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー aikon_marimo
提出日時 2018-01-30 21:55:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 518 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 73,996 KB
実行使用メモリ 41,552 KB
最終ジャッジ日時 2024-06-28 18:52:58
合計ジャッジ時間 6,677 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder.No637;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int cnt = 0;
		for (int i = 0; i < 5; i++) {
			int num = in.nextInt();
			if (num%3 == 0 && num%5 == 0) {
				cnt += 8;
			} else if (num%3 == 0 && num%5 != 0) {
				cnt += 4;
			} else if (num%5 == 0 && num%3 != 0) {
				cnt += 4;
			} else if (num%3 != 0 && num%5 != 0) {
				cnt += Integer.toString(num).length();
			}
		}
		System.out.println(cnt);
	}
}
0