Advertisement
Guest User

Convert

a guest
Jan 19th, 2018
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 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 Конзолен_конвертор_USD_към_BGN
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var num = double.Parse(Console.ReadLine());
  14. var first = Console.ReadLine();
  15. var second = Console.ReadLine();
  16.  
  17. if (first == "BGN")
  18. {
  19. if (second == "USD")
  20.  
  21. Console.WriteLine( Math.Round(num / 1.79549, 2));
  22.  
  23. else if (second == "EUR")
  24.  
  25. Console.WriteLine( Math.Round(num / 1.95583, 2));
  26.  
  27. else if (second == "GBP")
  28.  
  29. Console.WriteLine( Math.Round(num / 2.53405, 2));
  30.  
  31. }
  32. if (first == "USD")
  33. {
  34. if (second == "BGN")
  35.  
  36. Console.WriteLine(Math.Round(num * 1.79549, 2));
  37.  
  38. else if (second == "EUR")
  39.  
  40. Console.WriteLine(Math.Round(num * 1.79549 / 1.95583, 2));
  41.  
  42. else if (second == "GBP")
  43.  
  44. Console.WriteLine(Math.Round(num * 1.79549 / 2.53405, 2));
  45.  
  46. }
  47. if (first == "GBP")
  48. {
  49. if (second == "BGN")
  50.  
  51. Console.WriteLine(Math.Round(num * 2.53405 , 2));
  52.  
  53. else if (second == "USD")
  54.  
  55. Console.WriteLine(Math.Round(num * 2.53405 / 1.79549, 2));
  56.  
  57. else if (second == "EUR")
  58.  
  59. Console.WriteLine(Math.Round(num * 2.53405 / 1.95583 , 2));
  60.  
  61. }
  62. if (first == "EUR")
  63. {
  64. if (second == "BGN")
  65.  
  66. Console.WriteLine(Math.Round(num * 1.95583, 2));
  67.  
  68. else if (second == "USD")
  69.  
  70. Console.WriteLine(Math.Round(num * 1.95583 / 1.79549, 2));
  71.  
  72. else if (second == "GBP")
  73.  
  74. Console.WriteLine(Math.Round(num * 1.95583 / 2.53405, 2));
  75.  
  76. }
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement