結果

問題 No.637 X: Yet Another FizzBuzz Problem
ユーザー matsuyoshi30
提出日時 2018-05-15 23:40:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 571 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 85,948 KB
実行使用メモリ 41,472 KB
最終ジャッジ日時 2024-06-28 19:05:47
合計ジャッジ時間 7,326 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = 0;
        String ans = "";
        for(int i = 0; i < 5; i++) {
            a = in.nextInt();
            if(a % 15 == 0) {
                ans += "FizzBuzz";
            } else if(a % 3 == 0) {
                ans += "Fizz";
            } else if(a % 5 == 0) {
                ans += "Buzz";
            } else {
                ans += String.valueOf(a);
            }
        }

        System.out.println(ans.length());
    }
}
0