Advertisement
kmer

Untitled

Nov 10th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Two14
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double a = double.Parse(Console.ReadLine());
  10. string c = Console.ReadLine();
  11. string s = Console.ReadLine();
  12. if (c == "m" && s == "cm")
  13. {
  14. a = a * 100;
  15. } else if (c == "m" && s == "mm")
  16. {
  17. a = a * 1000;
  18. }
  19. else if (c == "cm" && s == "mm")
  20. {
  21. a = a * 10;
  22. }
  23. else if (c == "mm" && s == "cm")
  24. {
  25. a = a / 10;
  26. }
  27. else if (c == "mm" && s == "m")
  28. {
  29. a = a / 1000;
  30. }
  31. else if (c == "cm" && s == "m")
  32. {
  33. a = a / 100;
  34. }
  35. Console.WriteLine($"{a:f3}");
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement