結果

問題 No.82 市松模様
ユーザー TDTD
提出日時 2022-05-31 17:21:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 1,085 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 108,824 KB
実行使用メモリ 24,132 KB
最終ジャッジ日時 2023-10-21 00:41:19
合計ジャッジ時間 1,856 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,132 KB
testcase_01 AC 25 ms
24,132 KB
testcase_02 AC 25 ms
24,132 KB
testcase_03 AC 26 ms
24,132 KB
testcase_04 AC 26 ms
24,132 KB
testcase_05 AC 25 ms
24,132 KB
testcase_06 AC 27 ms
24,132 KB
testcase_07 AC 27 ms
24,132 KB
testcase_08 AC 30 ms
24,132 KB
testcase_09 AC 31 ms
24,132 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 yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int a = int.Parse(s[0]);//幅
            int b = int.Parse(s[1]);//高さ
            string[,] t = new string[b,a ];
            string bw = "W";
            if (bw == s[2])
            {
                bw = "B";
            }


            for(int i = 0; i <b; i++)
            {
                string f=s[2];
                string f1=bw;
                for(int j = 0; j < a; j++)
                {
                    if (i%2==1)
                    {
                        f = bw;
                        f1 = s[2];
                    }
                     
                    
                    if (j % 2 == 0)
                    {
                        t[i, j] = f;
                    }else{
                        t[i, j] = f1;
                    }
                    Console.Write(t[i, j]);
                }
                Console.WriteLine("");
            }
        }
    }
}
0