double UAH, USD, EUR, RUB;
cout << "Enter UAH:";
cin >> UAH;
cout << "USD exchange rate:";
cin >> USD;
cout << "EUR exchange rate:";
cin >> EUR;
cout << "RUB exchange rate:";
cin >> RUB;
int tmp = UAH / USD;
double ost = UAH - tmp*USD;
cout << tmp << " USD and you have " << ost << " UAH"<<endl;
tmp = UAH / EUR;
ost = UAH - tmp*EUR;
cout << tmp << " EUR and you have " << ost << " UAH" << endl;
tmp = UAH / RUB;
ost = UAH - tmp*RUB;
cout << tmp << " RUB and you have " << ost << " UAH" << endl;
system("pause");
cout << "Enter UAH:";
cin >> UAH;
cout << "USD exchange rate:";
cin >> USD;
cout << "EUR exchange rate:";
cin >> EUR;
cout << "RUB exchange rate:";
cin >> RUB;
int tmp = UAH / USD;
double ost = UAH - tmp*USD;
cout << tmp << " USD and you have " << ost << " UAH"<<endl;
tmp = UAH / EUR;
ost = UAH - tmp*EUR;
cout << tmp << " EUR and you have " << ost << " UAH" << endl;
tmp = UAH / RUB;
ost = UAH - tmp*RUB;
cout << tmp << " RUB and you have " << ost << " UAH" << endl;
system("pause");
Комментариев нет:
Отправить комментарий