Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double number = double.Parse(Console.ReadLine());
- string IN = Console.ReadLine();
- string OUT = Console.ReadLine();
- if ( IN == "m" )
- {
- if(OUT == "mm")
- {
- double mToMm = number * 1000;
- Console.WriteLine($"{mToMm:f3}");
- }
- if (OUT == "cm")
- {
- double toCm = number * 100;
- Console.WriteLine($"{toCm:f3}");
- }
- }
- else if (IN == "cm")
- {
- if (OUT == "m")
- {
- double inCmToM = number / 100;
- Console.WriteLine($"{inCmToM:f3}");
- }
- if (OUT == "mm")
- {
- double toMm = number * 10;
- Console.WriteLine($"{toMm:f3}");
- }
- }
- else if (IN == "mm")
- {
- if (OUT == "cm")
- {
- double mmToCm = number / 10;
- Console.WriteLine($"{mmToCm:f3}");
- }
- if(OUT == "m")
- {
- double toM = number / 1000;
- Console.WriteLine($"{toM:f3}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement