Advertisement
Somo4k

02. Spaceship

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