程序代码:
#include <stdio.h>
int main( )
{
int week,n;
scanf("%d",&week); /*当前星期几*/
week%=7;
do{
scanf("%d",&n); /*往后推移天数*/
while(n>6);
int n_week=(week+n)%7;
if(n_week-week>=0)
printf("不隔周\n");
else
printf("隔周\n");
return 0;
}
[此贴子已经被作者于2016-4-9 09:59编辑过]