Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Spaceship
- {
- class Program
- {
- static void Main(string[] args)
- {
- double width = double.Parse(Console.ReadLine());
- double length = double.Parse(Console.ReadLine());
- double height = double.Parse(Console.ReadLine());
- double averageHeight = double.Parse(Console.ReadLine());
- double spaceshipVolume = width * length * height;
- double astronautVolume = (averageHeight + 0.4) * 2 * 2;
- int team = (int)(spaceshipVolume / astronautVolume);
- if (team < 3)
- {
- Console.WriteLine("The spacecraft is too small.");
- }
- else if (team > 10)
- {
- Console.WriteLine("The spacecraft is too big.");
- }
- else
- {
- Console.WriteLine($"The spacecraft holds {team} astronauts.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement