Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _02._Spaceship
- {
- class Program
- {
- static void Main(string[] args)
- {
- double width = double.Parse(Console.ReadLine());
- double length = double.Parse(Console.ReadLine());
- double hight = double.Parse(Console.ReadLine());
- double austroHight = double.Parse(Console.ReadLine());
- double spacecraftVolume = width * length * hight;
- double roomVolume = (austroHight + 0.40) * 2 * 2;
- double numHumans = Math.Floor(spacecraftVolume / roomVolume);
- if (numHumans >= 3 && numHumans <= 10)
- {
- Console.WriteLine($"The spacecraft holds {numHumans} astronauts.");
- }
- else if (numHumans > 10)
- {
- Console.WriteLine($"The spacecraft is too big.");
- }
- else
- {
- Console.WriteLine($"The spacecraft is too small.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement