Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace seconds_cald
- {
- class Program
- {
- static void Main(string[] args)
- {
- double num = double.Parse(Console.ReadLine());
- string from = Console.ReadLine();
- string to = Console.ReadLine();
- double result = 0.0;
- if (from == "mm" && to == "cm")
- {
- result = num / 10;
- }
- else if (from == "mm" && to == "m")
- {
- result = num / 1000;
- }
- else if (from == "cm" && to == "mm")
- {
- result = num * 10;
- }
- else if (from == "m" && to == "cm")
- {
- result = num * 100;
- }
- else if (from == "cm" && to == "m")
- {
- result = num / 100;
- }
- else if (from == "m" && to == "mm")
- {
- result = num * 1000;
- }
- Console.WriteLine($"{result:F3}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement