Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. double num = double.Parse(Console.ReadLine());
  8. string outMernaEdinica = Console.ReadLine();
  9. string inMernaEdinica = Console.ReadLine();
  10.  
  11. if (outMernaEdinica == "m" && inMernaEdinica == "cm")
  12. {
  13. num = num * 100;
  14. }
  15. else if (outMernaEdinica == "mm" && inMernaEdinica == "m")
  16. {
  17. num = num / 1000;
  18. }
  19. else if (outMernaEdinica == "cm" && inMernaEdinica == "mm")
  20. {
  21. num = num * 10;
  22. }
  23. Console.WriteLine("{0:F3}", num);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement