标签:des style color io os ar java for sp
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
#include<stdio.h> #include<string.h> struct st { char zhengjian[20]; char kaishi[10]; char jieshu[10]; }data[100]; int main() { int T,n,i,j; struct st data[100],t; scanf("%d",&T); while(T--) { scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s %s %s",data[i].zhengjian,data[i].kaishi,data[i].jieshu); } for(i=0;i<n;i++) { for(j=i+1;j<n;j++) if(strcmp(data[i].kaishi,data[j].kaishi)>0) { t=data[i]; data[i]=data[j]; data[j]=t; } } printf("%s ",data[0].zhengjian); for(i=0;i<n;i++) { for(j=i+1;j<n;j++) if(strcmp(data[i].jieshu,data[j].jieshu)<0) { t=data[i]; data[i]=data[j]; data[j]=t; } } printf("%s\n",data[0].zhengjian); } return 0; }
标签:des style color io os ar java for sp
原文地址:http://blog.csdn.net/hdd871532887/article/details/40250695