//输入n个字符串,找到其中最小的字符串
#include<stdio.h>
#include<string.h>
int main()
{
int n,i;
scanf("%d",&n);
char ch[20],t[20];
scanf("%s",ch);
strcpy(t,ch);
for(i=1;i<=n-1;i++)
{
scanf("%s",ch);
if(strcmp(t,ch)>0)
{
strcpy(t,ch);
}
}
printf("%s",t);
return 0;
}
寻找最小的字符串
最新推荐文章于 2024-05-01 13:37:49 发布