Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- // Autonomy
- int main()
- {
- string s;
- int a, b, c;
- cin >> a >> b >> c;
- int v = a * b * c;
- getline(cin, s);
- int count = 0;
- for (;;)
- {
- getline(cin, s);
- if (s == "Done") break;
- count = count + stoi(s);
- if (count > v)
- {
- printf("No more free space! You need %d Cubic meters more.\n", count - v);
- return 0;
- }
- }
- printf("%d Cubic meters left.\n", v - count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement