結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー funakoshifunakoshi
提出日時 2019-07-01 11:56:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 1,700 bytes
コンパイル時間 4,579 ms
コンパイル使用メモリ 101,132 KB
実行使用メモリ 23,168 KB
最終ジャッジ日時 2023-09-22 20:17:45
合計ジャッジ時間 6,682 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,024 KB
testcase_01 AC 63 ms
21,128 KB
testcase_02 AC 66 ms
21,012 KB
testcase_03 AC 64 ms
21,012 KB
testcase_04 AC 65 ms
23,008 KB
testcase_05 AC 64 ms
21,136 KB
testcase_06 AC 64 ms
23,112 KB
testcase_07 AC 64 ms
21,140 KB
testcase_08 AC 63 ms
21,124 KB
testcase_09 AC 63 ms
21,208 KB
testcase_10 AC 63 ms
21,108 KB
testcase_11 AC 63 ms
21,164 KB
testcase_12 AC 64 ms
21,052 KB
testcase_13 AC 64 ms
23,168 KB
testcase_14 AC 64 ms
21,120 KB
testcase_15 AC 63 ms
21,176 KB
testcase_16 AC 63 ms
23,056 KB
testcase_17 AC 67 ms
21,144 KB
testcase_18 AC 63 ms
21,204 KB
testcase_19 AC 63 ms
21,104 KB
testcase_20 AC 68 ms
21,216 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]);
            bool uruu = false;
            if(year%100==0&&year%400!=0)
            {
                uruu = false;
            }
            else if(year%4==0)
            {
                uruu = true;
            }
            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 = day-31;
                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 = day-30;
            }
            else if(month==2&&uruu==true)
            {
                if (day > 29)
                {
                    month++;
                    day = day-29;
                }
            }
            else if(month==2&&day>28)
            {
                month++;
                day = day-28;
            }

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