Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int width, length, height;
- cin >> width >> length >> height;
- int freeSpace = width * length * height;
- string box;
- while (freeSpace > 0) {
- cin >> box;
- if (box == "Done") {
- break;
- }
- freeSpace -= stoi(box);
- }
- if (box == "Done") {
- cout << freeSpace << " Cubic meters left.\n";
- }
- else {
- cout << "No more free space! You need " << abs(freeSpace) << " Cubic meters more.";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement