Здавейте.Имам проблем със Currency Converter на C++.
Това е кода и ми дава 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;
cin >> new_currency;
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;
}
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;
}
Благодаря,явно трябва да почивам.