Untitled

 avatar
unknown
plain_text
4 years ago
911 B
6
Indexable
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main()
{
string country;
string article;
string L = "l'";

cout << "Enter a country name in CamelCase: ";
cin >> country;


if (country == "Belize" or "Cambodge" or "Mexique" or "Mozambique" or "Zaire" or "Zimbabwe")
{
article = "la";
string frenchName = article + " " + country;
cout << frenchName;
}

else if (country == "EtatsUnis" or "PaysBas")
{
article = "les";
string frenchName = article + " " + country;
cout << frenchName;
}


else if (country[0] = "A" or "E" or "I" or "O" or "U")
{
string vowelStart = L + country;
cout << vowelStart;
}

else if (country[country.length() - 1] == 'e')
{
article = "la";
string frenchName = article + " " + country;
cout << frenchName;
}

else
{
article = "le";
string frenchName = article + " " + country;
cout << frenchName;
}


cout << endl;
system("pause");
return EXIT_SUCCESS;
}
Editor is loading...