結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー takosama312
提出日時 2016-01-31 15:14:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 767 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 108,152 KB
実行使用メモリ 25,796 KB
最終ジャッジ日時 2024-09-21 19:39:33
合計ジャッジ時間 1,197 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 ConsoleApplication10
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int i = 0;
            bool flag = false;
            for(i=1;i<= N;i++)
            {
                flag = false;
                if (i % 3 == 0)
                {
                    Console.Write("Fizz");
                    flag = true;
                }
                if (i % 5 == 0)
                {
                    Console.Write("Buzz");
                    flag = true;
                }
                if(!flag)
                {
                    Console.Write(i);
                }
                Console.WriteLine();
            }
        }
      
    }
}
0