Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <iomanip>
- using namespace std;
- int main() {
- 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 GBP = "GBP";
- 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 == GBP) {
- ammount = ammount * payndove;
- }
- cin >> new_currency;
- if (new_currency == BGN) {
- ammount = ammount / levove;
- }
- else if (new_currency == USD) {
- ammount = ammount / dolari;
- }
- else if (new_currency == EUR) {
- ammount = ammount / evro;
- }
- else if (new_currency == GBP) {
- ammount = ammount / payndove;
- }
- printf_s("%.2f", ammount);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement