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 numForTransformation = double.Parse(Console.ReadLine());
- string inputValue = Console.ReadLine();
- string outputValue = Console.ReadLine();
- double velueCm = 0;
- if (inputValue=="mm")
- {
- velueCm = numForTransformation / 10;
- }
- else if (inputValue=="cm")
- {
- velueCm = numForTransformation * 1;
- }
- else if (inputValue=="m")
- {
- velueCm = numForTransformation *100.00;
- }
- double mirrorVelue = 0;
- if (outputValue=="mm")
- {
- mirrorVelue = velueCm * 10;
- }
- else if (outputValue=="m")
- {
- mirrorVelue = velueCm / 100;
- }
- else if (outputValue=="cm")
- {
- mirrorVelue = velueCm * 1;
- }
- Console.WriteLine($"{mirrorVelue:F3}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement