Input five countries' names :
china
germen
iran
iraq
french
The minimum is : china
Press any key to continue
*/
#include <iostream>
#include <cstring>
using namespace std;
int main() {
char str[5][80];
int i,index = 0; // 假定索引為0排在最前面
cout<<"Input five countries' names :\n";
for(i = 0; i < 5; i++) cin >> str[i];
for(i = 1; i < 5; ++i) { // 索引為i和index兩兩比較
if(strcmp(str[index],str[i]) >= 0) // 如果索引index排在後面
index = i; // 就保存更考前者
}
cout << "The minimum is : " << str[index] << endl;
return 0;
}