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