标签:
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 struct per{ 6 char name[20]; 7 char time1[10],time2[10]; 8 }; 9 int main() 10 { 11 int day,i; 12 freopen("in.txt","r",stdin); 13 cin>>day; 14 while(day--) 15 { 16 per p[1000]; 17 per min,max; 18 int count=0,j; 19 cin>>count; 20 for(j=0;j<count;j++) 21 { 22 cin>>p[j].name>>p[j].time1>>p[j].time2; 23 } 24 max=p[j-1]; 25 min=p[j-1]; 26 for(j=0;j<count;j++) 27 { 28 if(strcmp(p[j].time1,min.time1)<0) 29 min=p[j]; 30 if(strcmp(p[j].time2,max.time2)>0) 31 max=p[j]; 32 } 33 cout<<min.name<<‘ ‘<<max.name<<endl; 34 } 35 }
标签:
原文地址:http://www.cnblogs.com/a1225234/p/4591934.html