标签:
3 1 ME3021112225321 00:00:00 23:59:59 2 EE301218 08:05:35 20:56:35 MA301134 12:35:45 21:40:42 3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40
ME3021112225321 ME3021112225321 EE301218 MA301134 SC3021234 CS301133
gangkais
#include<stdio.h> struct stu{ int time[2]; int mi[2]; int se[2]; char num[17]; }work[1000]; int main() { int n,a,b,c,i,j,k,max,min; int x[1000],s[1000]; scanf("%d",&n); while(n--) { scanf("%d",&a); //while(a--) for(i=0;i<a;i++) { scanf("%s %d:%d:%d %d:%d:%d",work[i].num,&work[i].time[0],&work[i].mi[0],&work[i].se[0],&work[i].time[1],&work[i].mi[1],&work[i].se[1]); } //min=work[0].time[0],b=0; for(i=0;i<a;i++) { x[i]=work[i].time[0]*3600+work[i].mi[0]*60+work[i].se[0]; s[i]=work[i].time[1]*3600+work[i].mi[1]*60+work[i].se[1]; } min=x[0];max=s[0]; b=0,c=0; for(i=0;i<a;i++) if(min>x[i]) { min=x[i]; b=i; } for(i=0;i<a;i++) if(max<s[i]) { max=s[i]; c=i; } printf("%s %s\n",work[b].num,work[c].num); } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/l15738519366/article/details/47009321