问题 4021 --国家名(完善程序)

4021: 国家名(完善程序)

时间限制: 1 Sec  内存限制: 128 MB
提交: 402  解决: 273
[提交][状态][命题人:]

题目描述

有3个国家名,要求找出按字母顺序排在最前面的国家。要求用函数调用
#include<iostream>
#include<cstring>
using namespace std;
int main( )
{
    void smallest_string(char str[][30], int i);//函数声明
	char name[3][30];
	for(int i=0;i<3;i++)
	cin>>name[i];
	_______(1)________
    return 0;
}
void smallest_string(char str[][30],____(2)____)
{
	char a[30];
	strcpy(a,str[0]);
	for(int i=0;i<n;i++)
		if(_____(3)______)
			strcpy(a,str[i]);
	cout<<"the smallest name is: "<<a<<endl;
}

输入

输出

样例输入
Copy
GERMANY
FRANCE
CHINA
样例输出
Copy
the smallest name is: CHINA

提示

来源

[提交][状态]