License plate numberTime limit: 3000 ms | Memory limit: 65535 KB Difficulty: 1 Description Yan is very like to study the license plate number, from the license plate number can be seen registration of the morning and evening, according to the study found that the license plate number is issued according to the dictionary, and now she collects a lot of license plate number, please design procedures to help her judge the registration of The license plate number is composed of 5 letters or numbers. Enter the first row is N, the Representative has n group of data, the second row is M, the following m line is m license plate number
Where the n<100,m<1000 output registration of an earlier license plate number sample input
1
4
AA100
aa100
0o2r4
ye2er
Sample output
0o2r4
Analytical:
strcpy (S1,S2); s1 the string into S2.
strcmp (S1,S2); compares s1,s2 size, s1>s2, returns a positive value, S1=S2, returns a negative value for 0,S1<S2.
The procedure is as follows:
#include <cstdio>
#include <cstring>
int main ()
{
int t;
Char a[1003][6];
scanf ("%d", &t);
while (t--)
{
int m,i;
Char min[6];
scanf ("%d", &m);
for (i=0;i<m;i++)
scanf ("%s", A[i]);
strcpy (Min,a[0]);
for (i=1;i<m;i++)
if (strcmp (a[i],min) <0)
strcpy (min,a[i));
printf ("%s\n", min);
}
return 0;
}