#include<stdio.h> int main() { /* int X,N; int m,n; scanf("%d%d",&X,&N); m=X+N; n=(m-1)%7+1; printf("%d",n); */ int X,N,day; scanf("%d%d",&X,&N); day=X+N; if(day<=7)//若在同一周内的情况 printf("%d",day); else { N=N%7; day=X+N; if(day<=7)//若不同周,且求余相加小于7的情况 printf("%d",day); else { day=day-7;//不同周,但求余相加后大于7的情况 printf("%d",day); } } return 0;

}