题解 | #牛牛的计划#

牛牛的计划

https://www.nowcoder.com/practice/cf956ceef9f84f7393a0b7284fdbf95a

public class Program {
    public static void Main() {
        string line;
        string date = "";
        while ((line = System.Console.ReadLine()) != null) {
            if (date == "") {
                date = line;
            } else {
                if (line == date)
                    System.Console.WriteLine("yes");
                else {
                    string[] ydate = date.Split(" ");
                    string[] y1date = line.Split(" ");

                    int y = int.Parse(ydate[0]);
                    int m = int.Parse(ydate[1]);
                    int d = int.Parse(ydate[2]);

                    int y1 = int.Parse(y1date[0]);
                    int m1 = int.Parse(y1date[1]);
                    int d1 = int.Parse(y1date[2]);

                    if(y1>y)
                    {
                       System.Console.WriteLine("yes");
                    }
                    else if(y1==y&&m1>m)
                    {
                        System.Console.WriteLine("yes");
                    }
                    else if(y1==y&&m1==m&&d1>d)
                    {
                        System.Console.WriteLine("yes");
                    }
                    else
                    System.Console.WriteLine("no");
                }
            }

        };


    }
}

全部评论

相关推荐

喜欢走神的孤勇者练习时长两年半:爱华,信华,等华,黑华
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务