結果

問題 No.82 市松模様
ユーザー soi09476291soi09476291
提出日時 2019-11-16 18:38:46
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,734 bytes
コンパイル時間 812 ms
コンパイル使用メモリ 108,576 KB
実行使用メモリ 24,248 KB
最終ジャッジ日時 2023-10-25 07:50:13
合計ジャッジ時間 2,112 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;

            var input = Console.ReadLine().Split(' ');

            int W = int.Parse(input[0]);
            int H = int.Parse(input[1]);
            string C = input[2];

            for(int i = 0; i < H; i++)
            {
                while (true)
                {
                    if(C == "B")
                    {
                        Console.Write("B");

                        count++;

                        if(count >= W)
                        {
                            break;
                        }

                        Console.Write("W");

                        count++;

                        if(count >= W)
                        {
                            break;
                        }
                    }

                    if(C == "W")
                    {
                        Console.Write("W");

                        count++;

                        if(count >= W)
                        {
                            break;
                        }

                        Console.Write("B");

                        count++;

                        if(count >= W)
                        {
                            break;
                        }
                    }
                }

                if(C == "W")
                {
                    C = "B";
                }
                else if(C == "B")
                {
                    C = "W";
                }

                Console.WriteLine();

                count = 0;
            }

            Console.WriteLine();
        }
    }
}
0