結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー funakoshifunakoshi
提出日時 2019-07-01 11:39:24
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,461 bytes
コンパイル時間 2,712 ms
コンパイル使用メモリ 100,352 KB
実行使用メモリ 23,320 KB
最終ジャッジ日時 2023-09-22 19:41:52
合計ジャッジ時間 4,600 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,104 KB
testcase_01 AC 62 ms
19,156 KB
testcase_02 WA -
testcase_03 AC 63 ms
23,316 KB
testcase_04 AC 64 ms
21,188 KB
testcase_05 AC 64 ms
19,100 KB
testcase_06 AC 63 ms
23,320 KB
testcase_07 AC 63 ms
23,208 KB
testcase_08 AC 62 ms
23,104 KB
testcase_09 AC 63 ms
23,128 KB
testcase_10 AC 62 ms
23,248 KB
testcase_11 AC 63 ms
21,260 KB
testcase_12 AC 62 ms
21,072 KB
testcase_13 AC 61 ms
21,212 KB
testcase_14 AC 62 ms
23,212 KB
testcase_15 AC 62 ms
21,256 KB
testcase_16 AC 63 ms
21,092 KB
testcase_17 AC 62 ms
21,016 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 62 ms
21,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ymd = Console.ReadLine().Split('/');
            int year = int.Parse(ymd[0]);
            int month = int.Parse(ymd[1]);
            int day = int.Parse(ymd[2]);
            day += 2;
            if (month == 1 && day > 31 || month == 3 && day > 31 || month == 5 && day > 31  || month == 7 && day > 31 
                || month == 8 && day > 31 || month == 10 && day > 31 || month == 12 && day > 31)
            {
                month++;
                day = 2;
                if(month>12)
                {
                    year++;
                    month = 1;
                }
            }
            else if (month == 4 && day > 30 || month == 6 && day > 30 || month == 9 && day > 30 || month == 11 && day > 30)
            {
                month++;
                day = 2;
            }
            else if(month==2&&year%4==0)
            {
                if (day > 29)
                {
                    month++;
                    day = 1;
                }
            }
            else if(month==2&&day>28)
            {
                month++;
                day = 2;
            }

            Console.WriteLine("{0:00}"+"/"+ "{1:00}" + "/" + "{2:00}", year, month, day);
        }
    }
}
0