Advertisement
social1986

Untitled

Nov 1st, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _01.Wormtest
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var wormLength = int.Parse(Console.ReadLine());
  14. var wormWidth = double.Parse(Console.ReadLine());
  15. var lengthInCm = wormLength * 100;
  16. var reminder = lengthInCm % wormWidth;
  17.  
  18. if (reminder == 0 || lengthInCm == 0 || wormWidth == 0)
  19. {
  20. var result = lengthInCm * wormWidth;
  21. Console.WriteLine($"{result:f2}");
  22. }
  23. else
  24. {
  25. var result = lengthInCm / wormWidth * 100;
  26. Console.WriteLine($"{result:f2}%");
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement