NYOJ277 - 车牌号

描述 茵茵很喜欢研究车牌号码,从车牌号码上可以看出号码注册的早晚,据研究发现,车牌号码是按字典序发放的,现在她收集了很多车牌号码,请你设计程序帮她判断注册较早的号码。车牌号码由5个字母或数字组成
输入
第一行是n,代表有n组数据,第二行是m,以下m行是m个车牌号码
其中n<100,m<1000
输出
输出注册较早的车牌号
样例输入
1
4
AA100
aa100
0o2r4
ye2er
样例输出
0o2r4


#include<stdio.h>
#include<string.h>
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		int T1;
		char s[10];
		scanf("%d",&T1);
		scanf("%s",s);
		T1--;
		while(T1--){
			char ch[10];
			scanf("%s",ch);
			if(strcmp(ch,s) < 0)
				strcpy(s, ch);
		}
		puts(s);
	}
	return 0;
}        



posted @ 2017-01-26 15:56  gwj1139177410  阅读(131)  评论(0编辑  收藏  举报
选择