結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー 富浜富浜
提出日時 2015-04-06 15:42:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 627 bytes
コンパイル時間 2,574 ms
コンパイル使用メモリ 103,380 KB
実行使用メモリ 22,776 KB
最終ジャッジ日時 2023-09-17 06:12:04
合計ジャッジ時間 3,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
22,700 KB
testcase_01 AC 50 ms
20,676 KB
testcase_02 AC 51 ms
22,776 KB
testcase_03 AC 50 ms
20,648 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace OJcsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int m = int.Parse(Console.ReadLine());
            for (int n = 1; n <= m; n++)
            {
                if (n % 3 != 0 && n % 5 != 0)
                {
                    Console.Write(n);
                }
                if (n % 3 == 0)
                {
                    Console.Write("Fizz");
                }
                if (n % 5 == 0)
                {
                    Console.Write("Buzz");
                }
                Console.WriteLine();
            }
        }
    }
}
0