Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- // Spaceship
- int main()
- {
- double w, l, h, avh;
- cin >> w >> l >> h >> avh;
- double rocketvolume = w * l * h;
- double roomvolume = (avh + 0.4) * 2 * 2;
- double answer = floor(rocketvolume / roomvolume);
- if (answer > 10)
- {
- printf("The spacecraft is too big.\n");
- }
- else if (answer < 3)
- {
- printf("The spacecraft is too small.\n");
- }
- else
- {
- printf("The spacecraft holds %.0f astronauts.\n", answer);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement