#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
#include<stdlib.h>
int main() {
int n;
scanf("%d", &n);
int* in = malloc(n * sizeof(int));
for (int i = 0; i < n; i++) {
int x, y, z;
int temp;
scanf("%d %d %d", &x, &y, &z);
temp = (y + z) % 7;
if (temp == 0) {
temp = 7;
}
int s = (temp + x) % 7;
if (s == 0) {
s = 7;
}
in[i] = s;
}
for (int i = 0; i < n; i++) {
printf("%d\n", in[i]);
}
return 0;
}
//题目是y天前是星期z,求x天后星期几
//遇到这种多组数据一次性输入时,利用数组存储每一组的数据,大循环结束后输出结果
Comments NOTHING