結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー ほっしいー
提出日時 2018-02-11 00:59:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 119 ms / 1,000 ms
コード長 522 bytes
コンパイル時間 3,024 ms
コンパイル使用メモリ 75,128 KB
実行使用メモリ 41,380 KB
最終ジャッジ日時 2024-06-28 18:55:57
合計ジャッジ時間 7,342 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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];
		for(int i=0;i<5;i++) 
			a[i]=Integer.parseInt(sc.next());
		System.out.println(getNum(a));

	}
	
	public static int getNum(int[] a) {
		int x=0;
		for(int i=0;i<5;i++) 
			if((a[i]%3==0)&&(a[i]%5==0))
				x=x+8;
			else if(a[i]%3==0) 
				x=x+4;
			else if(a[i]%5==0)
				x=x+4;
			else {
				String b=Integer.toString(a[i]);
				x=x+b.length();
			}
		return x;
		}

}
0