讨论 / 这两份代码有区别吗?怎么C随便过,Python就永远不过?
Zickey 2018-09-11 16:52:12
点我顶贴 收藏 删除
C:

#include<stdio.h>

int main(){

int m,day,i,a,b,exceed;

m=day=0;

for(i=1;i<=7;i++){

scanf("%d%d",&a,&b);

exceed=a+b-8;

if(exceed>m){

m=exceed;

day=i;

}

}

printf("%d\n",day);

}

Python:

m=0;

day=0;

for i in range(1,8):

t=list(input());

exceed=int(t[0])+int(t[2])-8;

if exceed>m:

m=exceed;

day=i;

print(day,'\n');

查看更多回复
提交回复