Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- double width, length, height, averageHeight;
- cin >> width >> length >> height >> averageHeight;
- double spaceshipVolume = width * length * height;
- double astronautVolume = (averageHeight + 0.4) * 2 * 2;
- int team = (int)(spaceshipVolume / astronautVolume);
- if (team < 3) {
- cout << "The spacecraft is too small.\n";
- }
- else if (team > 10) {
- cout << "The spacecraft is too big.\n";
- }
- else {
- cout << "The spacecraft holds " << team << " astronauts.\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement