結果

問題 No.311 z in FizzBuzzString
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-01-09 21:03:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 648 bytes
コンパイル時間 1,943 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 57,952 KB
最終ジャッジ日時 2023-10-25 02:40:04
合計ジャッジ時間 4,011 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.next();
        int n = Integer.parseInt(str);
        int z = 0;
        
        for(int i = 0; i > n; i++) {
            if(i % 3 == 0) {
                if(i % 5 == 0) {
                    //FizzBuzz
                    z = z + 4;
                } else {
                    //Fizz
                    z = z + 2;
                }
            } else if(i % 5 == 0) {
                //Buzz
                z = z + 2;
            }
        }
        
        System.out.println(z);
    }
}
0