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