题解 | #牛牛的计划#
牛牛的计划
https://www.nowcoder.com/practice/cf956ceef9f84f7393a0b7284fdbf95a
#include <math.h>
#include <stdio.h>
void learning_procrastination(int a, int b, int c) {
int d, e, f;
scanf("%d %d %d", &d, &e, &f);//输入实际开始学习的时间:在计划时间之前无效,反之踩点和拖延有效
if (a > d) {//外层判断年
printf("no");
}
else if (a == d) {
if (b > e) {//年相等时判断月
printf("no");
}
else if (b == e) {
if (c > f) {//年、月均相等时判断日
printf("no");
}
else {
printf("yes");
}
}
else {
printf("yes");
}
}
else {
printf("yes");
}
}
int main() {
int a, b, c;
while (scanf("%d %d %d", &a, &b, &c) != EOF) {//输入计划开始学习的时间
learning_procrastination(a, b, c);
}
return 0;
}
查看11道真题和解析