Advertisement
Guest User

Untitled

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