题解 | #开学?#
开学?
http://www.nowcoder.com/practice/9cc35bd0754f4feca18e10e57c672467
#include <stdio.h>
int main()
{
int Week, Day;
scanf("%d%d", &Week, &Day);
printf("%d\n",(Week + Day - 1) % 7 + 1); //避免出现周日余数为0,兼顾简洁易懂
return 0;
}
开学?
http://www.nowcoder.com/practice/9cc35bd0754f4feca18e10e57c672467
#include <stdio.h>
int main()
{
int Week, Day;
scanf("%d%d", &Week, &Day);
printf("%d\n",(Week + Day - 1) % 7 + 1); //避免出现周日余数为0,兼顾简洁易懂
return 0;
}
相关推荐