Advertisement
tmollov

Untitled

Feb 4th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 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. namespace METRIC_CONVERTER
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. double numbersToConvert = double.Parse(Console.ReadLine());
  13. string firstNumber = Console.ReadLine();
  14. string secondNumber = Console.ReadLine();
  15. var currencies = new Dictionary<string, double>()
  16. {
  17. {"m", 1},
  18. {"mm", 1000 },
  19. {"cm", 100 },
  20. {"mi", 0.000621371192},
  21. {"in", 39.3700787},
  22. {"km", 0.001},
  23. {"ft", 3.2808399},
  24. {"yd", 1.0936133}
  25. };
  26. double result = numbersToConvert / currencies[firstNumber] * currencies[secondNumber];
  27.  
  28. Console.WriteLine("{0} {1}",result,secondNumber);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement