从题目可以看出,该程序不需要存储数据, 定义两个变量t=0和d=0,分别记录周几和每天的学习时间,边读入边比较即可。

#include<cstdio>

int main(){
    int x,y,t=0,d=0;
    for (int i=1;i<=7;i++){
        scanf("%d%d",&x,&y);
        if (x+y-8>d){
            d=x+y-8;
            t=i;
        }
    }
    printf("%d\n",t);
    return 0;
}
View Code

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2021-06-26
  • 2021-06-17
  • 2022-12-23
  • 2021-07-30
  • 2022-01-30
猜你喜欢
  • 2021-08-28
  • 2021-06-18
  • 2021-05-09
  • 2022-02-24
相关资源
相似解决方案