Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace TeamsOrganizer
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] currencyName = new string[] {"USD", "BGN", "GBP", "EUR"};
- decimal[] currencyValue = new decimal[] { 1.7435m, 1m, 2.6435m, 1.954m};
- decimal money = decimal.Parse(Console.ReadLine());
- string currency = Console.ReadLine();
- string wantedCurrency = Console.ReadLine();
- int index = -1;
- int indexWantedCurrency = -1;
- for (int i = 0; i < currencyName.Length; i++)
- {
- if (currencyName[i] == currency)
- {
- index = i;
- }
- if (currencyName[i] == wantedCurrency)
- {
- indexWantedCurrency = i;
- break;
- }
- }
- decimal moneyInLeva = money * currencyValue[index];
- decimal moneyResult = moneyInLeva / currencyValue[indexWantedCurrency];
- Console.WriteLine(moneyResult);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment