1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【额外练习】循环结构/7-6 循环-生气的峰峰.c

20 lines
333 B
C
Raw Normal View History

2024-11-18 15:10:07 +00:00
#include <stdio.h>
int a[7][2];
int max = 0, day = 0;
int main() {
for (int i = 0; i < 7; i++) {
scanf("%d %d", &a[i][0], &a[i][1]);
if (a[i][0] + a[i][1] > 8 && a[i][0] + a[i][1] > max) {
max = a[i][0] + a[i][1];
day = i + 1;
}
}
printf("%d\n", day);
return 0;
}