#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
int main()
{
setlocale(LC_ALL, "russian");
int one;
int five;
int ten;
int twentyfive;
int fifty;
int dollar;
string suff11;
string suff12;
string suff51;
string suff52;
string suff101;
string suff102;
string suff251;
string suff252;
string suff501;
string suff502;
string suff01;
string suff02;
suff11 = "";
suff12 = "";
suff51 = "";
suff52 = "";
suff101 = "";
suff102 = "";
suff251 = "";
suff252 = "";
suff501 = "";
suff502 = "";
suff01 = "";
suff02 = "";
cout << "Введите количество одноцентовых монет: ";
cin >> one;
cout << "Введите количество пятицентовых монет: ";
cin >> five;
cout << "Введите количество десятицентовых монет: ";
cin >> ten;
cout << "Введите количество двадцати пяти центовых монет: ";
cin >> twentyfive;
cout << "Введите количество пятидесятицентовых монет: ";
cin >> fifty;
cout << "Введите количество долларовых монет: ";
cin >> dollar;
if ((one > 4) && (one < 100))
{
suff11 = "ых";
suff12 = "";
}
if ((one == 1)
|| (one == 21)
|| (one == 31)
|| (one == 41)
|| (one == 51)
|| (one == 61)
|| (one == 71)
|| (one == 81)
|| (one == 91))
{
suff11 = "ая";
suff12 = "а";
}
if ((one > 1) && (one <= 4)
|| (one > 21) && (one <= 24)
|| (one > 31) && (one <= 34)
|| (one > 41) && (one <= 44)
|| (one > 51) && (one <= 54)
|| (one > 61) && (one <= 64)
|| (one > 71) && (one <= 74)
|| (one > 81) && (one <= 84)
|| (one > 91) && (one <= 94))
{
suff11 = "ые";
suff12 = "ы";
}
if ((five > 4) && (five < 100))
{
suff51 = "ых";
suff52 = "";
}
if ((five == 1)
|| (five == 21)
|| (five == 31)
|| (five == 41)
|| (five == 51)
|| (five == 61)
|| (five == 71)
|| (five == 81)
|| (five == 91))
{
suff51 = "ая";
suff52 = "а";
}
if ((five > 1) && (five <= 4)
|| (five > 21) && (five <= 24)
|| (five > 31) && (five <= 34)
|| (five > 41) && (five <= 44)
|| (five > 51) && (five <= 54)
|| (five > 61) && (five <= 64)
|| (five > 71) && (five <= 74)
|| (five > 81) && (five <= 84)
|| (five > 91) && (five <= 94))
{
suff51 = "ые";
suff52 = "ы";
}
if ((ten > 4) && (ten < 100))
{
suff101 = "ых";
suff102 = "";
}
if ((ten == 1)
|| (ten == 21)
|| (ten == 31)
|| (ten == 41)
|| (ten == 51)
|| (ten == 61)
|| (ten == 71)
|| (ten == 81)
|| (ten == 91))
{
suff101 = "ая";
suff102 = "а";
}
if ((ten > 1) && (ten <= 4)
|| (ten > 21) && (ten <= 24)
|| (ten > 31) && (ten <= 34)
|| (ten > 41) && (ten <= 44)
|| (ten > 51) && (ten <= 54)
|| (ten > 61) && (ten <= 64)
|| (ten > 71) && (ten <= 74)
|| (ten > 81) && (ten <= 84)
|| (ten > 91) && (ten <= 94))
{
suff101 = "ые";
suff102 = "ы";
}
if ((twentyfive > 4) && (twentyfive < 100))
{
suff251 = "ых";
suff252 = "";
}
if ((twentyfive == 1)
|| (twentyfive == 21)
|| (twentyfive == 31)
|| (twentyfive == 41)
|| (twentyfive == 51)
|| (twentyfive == 61)
|| (twentyfive == 71)
|| (twentyfive == 81)
|| (twentyfive == 91))
{
suff251 = "ая";
suff252 = "а";
}
if ((twentyfive > 1) && (twentyfive <= 4)
|| (twentyfive > 21) && (twentyfive <= 24)
|| (twentyfive > 31) && (twentyfive <= 34)
|| (twentyfive > 41) && (twentyfive <= 44)
|| (twentyfive > 51) && (twentyfive <= 54)
|| (twentyfive > 61) && (twentyfive <= 64)
|| (twentyfive > 71) && (twentyfive <= 74)
|| (twentyfive > 81) && (twentyfive <= 84)
|| (twentyfive > 91) && (twentyfive <= 94))
{
suff251 = "ые";
suff252 = "ы";
}
if ((fifty > 4) && (fifty < 100))
{
suff501 = "ых";
suff502 = "";
}
if ((fifty == 1)
|| (fifty == 21)
|| (fifty == 31)
|| (fifty == 41)
|| (fifty == 51)
|| (fifty == 61)
|| (fifty == 71)
|| (fifty == 81)
|| (fifty == 91))
{
suff501 = "ая";
suff502 = "а";
}
if ((fifty > 1) && (fifty <= 4)
|| (fifty > 21) && (fifty <= 24)
|| (fifty > 31) && (fifty <= 34)
|| (fifty > 41) && (fifty <= 44)
|| (fifty > 51) && (fifty <= 54)
|| (fifty > 61) && (fifty <= 64)
|| (fifty > 71) && (fifty <= 74)
|| (fifty > 81) && (fifty <= 84)
|| (fifty > 91) && (fifty <= 94))
{
suff501 = "ые";
suff502 = "ы";
}
if ((dollar > 4) && (dollar < 100))
{
suff01 = "ых";
suff02 = "";
}
if ((dollar == 1)
|| (dollar == 21)
|| (dollar == 31)
|| (dollar == 41)
|| (dollar == 51)
|| (dollar == 61)
|| (dollar == 71)
|| (dollar == 81)
|| (dollar == 91))
{
suff01 = "ая";
suff02 = "а";
}
if ((dollar > 1) && (dollar <= 4)
|| (dollar > 21) && (dollar <= 24)
|| (dollar > 31) && (dollar <= 34)
|| (dollar > 41) && (dollar <= 44)
|| (dollar > 51) && (dollar <= 54)
|| (dollar > 61) && (dollar <= 64)
|| (dollar > 71) && (dollar <= 74)
|| (dollar > 81) && (dollar <= 84)
|| (dollar > 91) && (dollar <= 94))
{
suff01 = "ые";
suff02 = "ы";
}
cout << "У вас " << one << " одноцентов" << suff11 << " монет" << suff12 << ".\n"
<< "У вас " << five << " пятицентов" << suff51 << " монет" << suff52 << ".\n"
<< "У вас " << ten << " десятицентов" << suff101 << " монет" << suff102 << ".\n"
<< "У вас " << twentyfive << " двадцати пяти центов" << suff251 << " монет" << suff252 << ".\n"
<< "У вас " << fifty << " пятидесяти центов" << suff501 << " монет" << suff502 << ".\n"
<< "У вас " << dollar << " долларов" << suff01 << " монет" << suff02 << ".\n";
_getch();
return 0;
}