1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main ()
{
string latin;
string ae = "ae";
string arum = "arum";
string is = "is";
string am = "am";
string as = "as";
string orum = "orum";
string um = "um";
string os = "os";
string a = "a";
string i = "i";
string o = "o";
while (latin != "QUIT")
{
getline(cin, latin);
string nominative = latin.substr(0, (latin.find(' ', 0)));
string genitive = latin.substr(latin.find(" ") + 1);
genitive = genitive.substr(0, genitive.length());
if (genitive.substr((genitive.length()-2), 2) == "ae")
{
cout << "Nom " << left << setw(8) << nominative << left << setw(8) << genitive.replace((genitive.length()-2), 2, ae) << endl;
cout << "Gen " << left << setw(8) << genitive.replace((genitive.length()-2), 2, ae) << left << setw(8) << genitive.replace((genitive.length()-2), 2, arum) << endl;
cout << "Dat " << left << setw(8) << genitive.replace((genitive.length()-4), 4, ae) << left << setw(8) << genitive.replace((genitive.length()-2), 2, is) << endl;
cout << "Acc " << left << setw(8) << genitive.replace((genitive.length()-2), 2, am) << left << setw(8) << genitive.replace((genitive.length()-2), 2, as) << endl;
cout << "Abl " << left << setw(8) << genitive.replace((genitive.length()-2), 2, a) << left << setw(8) << genitive.replace((genitive.length()-1), 1, is) << endl;
}
else if (genitive.substr((genitive.length()-1), 1) == "i")
{
if ((nominative.substr((nominative.length()-2), 2) == "us") || (nominative.substr((nominative.length()-1), 1) == "r"))
{
cout << "Nom " << left << setw(8) << nominative << left << setw(8) << genitive.replace((genitive.length()-1), 1, i) << endl;
cout << "Gen " << left << setw(8) << genitive.replace((genitive.length()-1), 1, i) << left << setw(8) << genitive.replace((genitive.length()-1), 1, orum) << endl;
cout << "Dat " << left << setw(8) << genitive.replace((genitive.length()-4), 4, o) << left << setw(8) << genitive.replace((genitive.length()-1), 1, is) << endl;
cout << "Acc " << left << setw(8) << genitive.replace((genitive.length()-2), 2, um) << left << setw(8) << genitive.replace((genitive.length()-2), 2, os) << endl;
cout << "Abl " << left << setw(8) << genitive.replace((genitive.length()-2), 2, o) << left << setw(8) << genitive.replace((genitive.length()-1), 1, is) << endl;
}
else if (nominative.substr((nominative.length()-2), 2) == "um")
{
cout << "Nom " << left << setw(8) << nominative << left << setw(8) << genitive.replace((genitive.length()-1), 1, a) << endl;
cout << "Gen " << left << setw(8) << genitive.replace((genitive.length()-1), 1, i) << left << setw(8) << genitive.replace((genitive.length()-1), 1, orum) << endl;
cout << "Dat " << left << setw(8) << genitive.replace((genitive.length()-4), 4, o) << left << setw(8) << genitive.replace((genitive.length()-1), 1, is) << endl;
cout << "Acc " << left << setw(8) << genitive.replace((genitive.length()-2), 2, um) << left << setw(8) << genitive.replace((genitive.length()-2), 2, a) << endl;
cout << "Abl " << left << setw(8) << genitive.replace((genitive.length()-1), 1, o) << left << setw(8) << genitive.replace((genitive.length()-1), 1, is) << endl;
}
}
}
return 0;
}
|