Advertisement
Guest User

convertor

a guest
Feb 14th, 2016
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConvertorHArd
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var num = double.Parse(Console.ReadLine());
  14.             var first = Console.ReadLine().ToLower();
  15.             var second = Console.ReadLine().ToLower();
  16.            
  17.             if (first == "usd")
  18.                 num *= 1.79549;
  19.             else if (first == "gbp")
  20.                 num *= 2.53405;
  21.             else if (first == "eur")
  22.                 num *= 1.95583;
  23.  
  24.             if (second == "usd")
  25.                 num /= 1.79549;
  26.             else if (second == "gbp")
  27.                 num /= 2.53405;
  28.             else if (second == "eur")
  29.                 num /= 1.95583;
  30.             Console.WriteLine(Math.Round(num,2));
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement