Advertisement
Sim0o0na

Untitled

Jan 24th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 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 ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double volue = double.Parse(Console.ReadLine());
  14.             string firstCurrensy = (Console.ReadLine());
  15.             string secondCurrensy = (Console.ReadLine());
  16.             double result = 0.0;
  17.  
  18.             double BGN = 1;
  19.             double USD = 1.79549;
  20.             double EUR = 1.95583;
  21.             double GBP = 2.53405;
  22.             if (firstCurrensy == "lv")
  23.             {
  24.                 if (secondCurrensy == "$")
  25.                 {
  26.                     result = volue * (BGN / USD);
  27.                 }
  28.                 else if (secondCurrensy == "eu")
  29.                 {
  30.                     result = volue * (BGN / EUR);
  31.                 }
  32.                 else if (secondCurrensy == "pnd")
  33.                 {
  34.                     result = volue * (BGN / GBP);
  35.                 }
  36.             }
  37.             else if (firstCurrensy == "$")
  38.             {
  39.                 if (secondCurrensy == "lv")
  40.                 {
  41.                     result = volue * (USD / BGN);
  42.                 }
  43.                 else if (secondCurrensy == "eu")
  44.                 {
  45.                     result = volue * (USD / EUR);
  46.                 }
  47.                 else if (secondCurrensy == "pnd")
  48.                 {
  49.                     result = volue * (USD / GBP);
  50.                 }
  51.             }
  52.             else if (firstCurrensy == "eu")
  53.             {
  54.                 if (secondCurrensy == "lv")
  55.                 {
  56.                     result = volue * (EUR / BGN);
  57.                 }
  58.                 else if (secondCurrensy == "$")
  59.                 {
  60.                     result = volue * (EUR / USD);
  61.                 }
  62.                 else if (secondCurrensy == "pnd")
  63.                 {
  64.                     result = volue * (EUR / GBP);
  65.                 }
  66.             }
  67.             else if (firstCurrensy == "pnd")
  68.             {
  69.                 if (secondCurrensy == "lv")
  70.                 {
  71.                     result = volue * (GBP / BGN);
  72.                 }
  73.                 else if (secondCurrensy == "$")
  74.                 {
  75.                     result = volue * (GBP / USD);
  76.                 }
  77.                 else if (secondCurrensy == "eu")
  78.                 {
  79.                     result = volue * (GBP / EUR);
  80.                 }
  81.             }
  82.             Console.WriteLine(result + " " + secondCurrensy);
  83.         }
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement