Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp30
- {
- class Program
- {
- static void Main(string[] args)
- {
- double widthSpaceship = double.Parse(Console.ReadLine());
- double lengthSpaceship = double.Parse(Console.ReadLine());
- double highSpaceship = double.Parse(Console.ReadLine());
- double highAustronafts = double.Parse(Console.ReadLine());
- double totalSpaceship = widthSpaceship * lengthSpaceship * highSpaceship;
- double roomSpace = (highAustronafts + 0.40) * 2 * 2;
- double space = Math.Floor(totalSpaceship / roomSpace);
- if (space >= 3 && space <= 10)
- {
- Console.WriteLine($"The spacecraft holds {Math.Floor(space)} astronauts.");
- }
- else if (space < 3)
- {
- Console.WriteLine("The spacecraft is too small.");
- }
- else if (space > 10)
- {
- Console.WriteLine("The spacecraft is too big.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment