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 widht = double.Parse(Console.ReadLine());
- double lenght = double.Parse(Console.ReadLine());
- double height = double.Parse(Console.ReadLine());
- double averageHeightAStro = double.Parse(Console.ReadLine());
- double valueSpaceship = widht * height * lenght;
- double valueRoom = (1.70 + 0.40) * 2 * 2;
- double astronauts = Math.Floor(valueSpaceship / valueRoom);
- if (astronauts > 10)
- {
- Console.WriteLine("The spacecraft is too big.");
- }
- else if (astronauts <= 10 && astronauts >= 3)
- {
- Console.WriteLine($"The spacecraft holds {astronauts} astronauts.");
- }
- else
- {
- Console.WriteLine("The spacecraft is too small.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement