NYOJ--277 License plate number "water problem"

Source: Internet
Author: User
Tags min time limit
License plate numberTime limit: Ms | Memory limit: 65535 KB Difficulty: 1 description Yan Yan very like to study the license plate number, from the license plate number can see the number registration sooner or later, according to the study found that the license plate number is issued in dictionary order, now she collects a lot of license plate number, please design procedures to help her judge the registration of the earlier number. The license plate number consists of 5 letters or numbers. Input the first line is N, which represents n sets of data, the second row is M, the following M-line is M license plate number
Where the n<100,m<1000 output register an earlier license plate number sample input
1
4
AA100
aa100
0o2r4
ye2er
Sample output
0o2r4
#include <cstdio>
#include <cstring>

char str[1010][10];

int main () {
    int n,m,i;
    scanf ("%d", &n);
    while (n--) {
        scanf ("%d", &m);
        for (i=0;i<m;++i) {
          scanf ("%s", Str[i]);
          if (strcmp (str[i],str[0]) <0)
            strcpy (Str[0],str[i]);
        }
        printf ("%s\n", Str[0]);
    }
    return 0;
}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.