题解 | 开学?
#include <stdio.h>
int main()
{
int x,n;
scanf("%d %d",&x,&n);
n=n%7;//一周7天固定的,先%7
x=x+n;
if(x>7)考虑相加超过7的情况
{
x=x-7;
}
printf("%d",x);
return 0;
}
#include <stdio.h>
int main()
{
int x,n;
scanf("%d %d",&x,&n);
n=n%7;//一周7天固定的,先%7
x=x+n;
if(x>7)考虑相加超过7的情况
{
x=x-7;
}
printf("%d",x);
return 0;
}
相关推荐