結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー nokonoko
提出日時 2015-06-28 11:25:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 109,812 KB
実行使用メモリ 23,780 KB
最終ジャッジ日時 2024-07-07 20:24:26
合計ジャッジ時間 1,166 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace YukiCoderNo9002
{
    class Program
    {
        static void Main()
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 1; i <= n; i++)
            {
                string answer = "";
                if ((i % 3) == 0)
                {
                    answer += "Fizz";
                }
                if ((i % 5) == 0)
                {
                    answer += "Buzz";
                }
                if (answer == "")
                {
                    answer = i.ToString();
                }
                Console.WriteLine("{0}", answer);
            }
        }
    }
}
0