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 MetricConverter
- {
- class Program
- {
- static void Main(string[] args)
- {
- var a = double.Parse(Console.ReadLine());
- var vh = Console.ReadLine();
- var izh = Console.ReadLine();
- if (vh == "mm")
- {
- a = a / 1000;
- }
- else if (vh == "cm")
- {
- a = a / 100;
- }
- else if (vh == "mi")
- {
- a = a / 0.000621371192;
- }
- else if (vh == "in")
- {
- a = a / 39.3700787;
- }
- else if (vh == "km")
- {
- a = a / 0.001;
- }
- else if (vh == "ft")
- {
- a = a / 3.2808399;
- }
- else if (vh == "yd")
- {
- a = a / 1.0936133;
- }
- if (izh == "mm")
- {
- a = a * 1000;
- }
- else if (izh =="cm")
- {
- a = a * 100;
- }
- else if (izh == "mi")
- {
- a = a * 0.000621371192;
- }
- else if (izh == "in")
- {
- a = a * 39.3700787;
- }
- else if (izh == "km")
- {
- a = a * 0.001;
- }
- else if (izh == "ft")
- {
- a = a * 3.2808399;
- }
- else if (izh == "yd")
- {
- a = a * 1.0936133;
- }
- Console.Write(a);
- Console.WriteLine(" "+izh);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement