Advertisement
Guest User

Валутен Конвертор

a guest
Apr 3rd, 2016
2,286
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 USDtoBGN
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double num = double.Parse(Console.ReadLine());
  14. var first = Console.ReadLine();
  15. var second = Console.ReadLine();
  16.  
  17. if (first == "usd")
  18. {
  19. if (second == "bgn")
  20. {
  21. Console.WriteLine("{0}",Math.Round(num * 1.79549,2));
  22. }
  23. else if (second == "eur")
  24. {
  25. Console.WriteLine("{0}",Math.Round(num * 0.91801,2));
  26. }
  27. else if (second == "gbp")
  28. {
  29. Console.WriteLine("{0}", Math.Round(num * 0.70854, 2));
  30. }
  31.  
  32. }
  33.  
  34. if (first == "bgn")
  35. {
  36. if (second == "usd")
  37. {
  38. Console.WriteLine("{0}", Math.Round(num / 1.79549,2));
  39. }
  40. else if (second == "eur")
  41. {
  42. Console.WriteLine("{0}", Math.Round(num / 1.95583,2));
  43. }
  44. else if (second == "gbp")
  45. {
  46. Console.WriteLine("{0}", Math.Round(num / 2.53405,2));
  47. }
  48. }
  49.  
  50. if (first == "eur")
  51. {
  52. if (second == "bgn")
  53. {
  54. Console.WriteLine("{0}", Math.Round(num * 2.53405, 2));
  55. }
  56. else if (second == "usd")
  57. {
  58. Console.WriteLine("{0}", Math.Round(num * 1.08930, 2));
  59. }
  60. else if (second == "gbp")
  61. {
  62. Console.WriteLine("{0}", Math.Round(num * 0.77181, 2));
  63. }
  64. }
  65. if (first == "gbp")
  66. if (second == "bgn")
  67. {
  68. Console.WriteLine("{0}", Math.Round(num * 0.39462, 2));
  69. }
  70. else if (second == "usd")
  71. {
  72. Console.WriteLine("{0}", Math.Round(num * 0.70854, 2));
  73. }
  74. else if (second == "eur")
  75. {
  76. Console.WriteLine("{0}", Math.Round(num * 0.77181, 2));
  77. }
  78. }
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement