3486 最大的单词

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;

	
	char maxn[51],t[51];
    //先输入第一个单词
	cin>>maxn;
	n--; //数量-1
    
	while(n--){
		cin>>t;
        //字符数组的比较函数strcmp()、复制字函数strcpy()
        //必须写>0,因为比较是计数的
		if(strcmp(t,maxn)>0) strcpy(maxn,t);
		
	}
	
	cout<<maxn;
	
	return 0;
}
posted @ 2024-10-31 15:02  行胜于言Ibl  阅读(118)  评论(0)    收藏  举报