题解 | #牛牛的计划#
牛牛的计划
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");
                }
            }
        };
    }
}
查看16道真题和解析
联想公司福利 1505人发布

