NYOJ 53 不高兴的小明
2014-02-11 15:11
183 查看
原题链接
简单题
附ac代码:
#include <stdio.h>
struct Unhappy{
int day, time;
};
int main(){
Unhappy stu;
int t, a, b;
scanf("%d", &t);
while(t--){
stu.time = stu.day = 0;
int i = 0;
while(i++ < 7){
scanf("%d%d", &a, &b);
if(a + b - 8 > stu.time)
stu.time = a + b - 8, stu.day = i;
}
printf("%d\n", stu.day);
}
return 0;
}
简单题
附ac代码:
#include <stdio.h>
struct Unhappy{
int day, time;
};
int main(){
Unhappy stu;
int t, a, b;
scanf("%d", &t);
while(t--){
stu.time = stu.day = 0;
int i = 0;
while(i++ < 7){
scanf("%d%d", &a, &b);
if(a + b - 8 > stu.time)
stu.time = a + b - 8, stu.day = i;
}
printf("%d\n", stu.day);
}
return 0;
}
相关文章推荐