Advertisement
onqkoie

Untitled

Nov 25th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 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 Spaceship
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double w = double.Parse(Console.ReadLine());
  14. double l = double.Parse(Console.ReadLine());
  15. double h = double.Parse(Console.ReadLine());
  16. double heightAustronavts = double.Parse(Console.ReadLine());
  17.  
  18. double volumeRoket = w * l * h;
  19. double volumeRoom = (1.70 + 0.40) * 2 * 2;
  20.  
  21. double placeFor = Math.Floor(volumeRoket / volumeRoom);
  22. if (placeFor <= 10 && placeFor >3 )
  23. {
  24. Console.WriteLine($"The spacecraft holds {placeFor} astronauts.");
  25. }
  26. else if (placeFor <= 3)
  27. {
  28. Console.WriteLine("The spacecraft is too small.");
  29. }
  30. else if(placeFor > 10)
  31. {
  32. Console.WriteLine("The spacecraft is too big.");
  33.  
  34. }
  35.  
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement