南阳oj入门题-车牌号

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Mind_programmonkey/article/details/87882922
/**
车牌号
时间限制:3000 ms  |  内存限制:65535 KB
难度:1
描述
茵茵很喜欢研究车牌号码,从车牌号码上可以看出号码注册的早晚,据研究发现,车牌号码是按字典序发放的,现在她收集了很多车牌号码,请你设计程序帮她判断注册较早的号码。车牌号码由5个字母或数字组成
输入
第一行是n,代表有n组数据,第二行是m,以下m行是m个车牌号码
其中n<100,m<1000
输出
输出注册较早的车牌号
样例输入
1
4
AA100
aa100
0o2r4
ye2er
样例输出
0o2r4
*/
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define maxsize 6
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		int m;
		string s,temp="zzzzzz";
		cin>>m;
		while(m--)
		{
			cin>>s;
			if(temp>s)
				temp=s;
		}
		cout<<temp<<endl;
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/Mind_programmonkey/article/details/87882922