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 _01.Wormtest
- {
- class Program
- {
- static void Main(string[] args)
- {
- var wormLength = int.Parse(Console.ReadLine());
- var wormWidth = double.Parse(Console.ReadLine());
- var lengthInCm = wormLength * 100;
- var reminder = lengthInCm % wormWidth;
- if (reminder == 0 || lengthInCm == 0 || wormWidth == 0)
- {
- var result = lengthInCm * wormWidth;
- Console.WriteLine($"{result:f2}");
- }
- else
- {
- var result = lengthInCm / wormWidth * 100;
- Console.WriteLine($"{result:f2}%");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement