Advertisement
ZuRi4i

Untitled

Dec 12th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Spaceship
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double widht = double.Parse(Console.ReadLine());
  10. double lenght = double.Parse(Console.ReadLine());
  11. double height = double.Parse(Console.ReadLine());
  12. double averageHeightAStro = double.Parse(Console.ReadLine());
  13.  
  14. double valueSpaceship = widht * height * lenght;
  15. double valueRoom = (1.70 + 0.40) * 2 * 2;
  16. double astronauts = Math.Floor(valueSpaceship / valueRoom);
  17.  
  18. if (astronauts > 10)
  19. {
  20. Console.WriteLine("The spacecraft is too big.");
  21. }
  22.  
  23. else if (astronauts <= 10 && astronauts >= 3)
  24. {
  25. Console.WriteLine($"The spacecraft holds {astronauts} astronauts.");
  26.  
  27. }
  28. else
  29. {
  30. Console.WriteLine("The spacecraft is too small.");
  31. }
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement