Advertisement
Icakman

Space Ship

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