[C++ Programming] C++ Currency Converter.
При проверка ми дава 60/100 и не мога да разбера защо.
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
cout.precision(2);
cout << fixed;
double levove = 1;
double dolari = 1.79549;
double evro = 1.95583;
double payndove = 2.53405;
string BGN = "BGN";
string USD = "USD";
string EUR = "EUR";
string BGP = "BGP";
string input_money;
string new_currency;
double ammount;
cin >> ammount;
cin >> input_money;
if (input_money == BGN) {
ammount = ammount * levove;
}
else if (input_money == USD) {
ammount = ammount * dolari;
}
else if (input_money == EUR) {
ammount = ammount * evro;
}
else if (input_money == BGP) {
ammount = ammount * payndove;
}
cin >> new_currency;
if (new_currency == BGN) {
ammount = ammount / levove;
cout << ammount << endl;
}
else if (new_currency == USD) {
ammount = ammount / dolari;
cout << ammount << endl;
}
else if (new_currency == EUR) {
ammount = ammount / evro;
cout << ammount << endl;
}
else if (new_currency == BGP) {
ammount = ammount / payndove;
cout << ammount << endl;
}
return 0;
}
Еее хав амй лайк гъзи.