Advertisement
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 ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- double h = double.Parse(Console.ReadLine());
- double pph = double.Parse(Console.ReadLine());
- double rocketV = a * b * h;
- double roomV = (pph + 0.40) * 2 * 2;
- double pp = rocketV / roomV;
- double people = (Math.Floor(pp));
- if (people >= 3 && people <= 10)
- {
- Console.WriteLine($"The spacecraft holds {people} astronauts.");
- }
- else if (people > 10)
- {
- Console.WriteLine("The spacecraft is too big.");
- }
- else if (people < 3)
- {
- Console.WriteLine("The spacecraft is too small.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement