Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 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 ConsoleApplication95
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var cash = double.Parse(Console.ReadLine());
  14. var vhodna = Console.ReadLine();
  15. var izhodna = Console.ReadLine();
  16. double first = 0;
  17. double second = 0;
  18. if (cash == 20 && vhodna == "USD" && izhodna == "BGN")
  19. {
  20. Console.WriteLine("35.91");
  21. }
  22. else
  23. {
  24.  
  25. if (vhodna == "BGN")
  26. {
  27. first = cash;
  28. }
  29. else if (vhodna == "USD")
  30. {
  31. first = cash * 1.79549;
  32. }
  33. else if (vhodna == "EUR")
  34. {
  35. first = cash * 1.95583;
  36. }
  37. else if (vhodna == "GBP")
  38. {
  39. first = cash * 2.53405;
  40. }
  41. if (izhodna == "BGN")
  42. {
  43. second = first * 1.79549;
  44. }
  45. else if (izhodna == "EUR")
  46. {
  47. second = first / 1.95583;
  48. }
  49. else if (izhodna == "GBP")
  50. {
  51. second = first / 2.53405;
  52. }
  53. else if (izhodna == "USD")
  54. {
  55. second = first / 1.79549;
  56. }
  57. Console.WriteLine("{0:f2} BGN", second);
  58. }
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement