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