Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double budget, salary;
- cin >> budget;
- cin.ignore();
- string actor;
- while (budget >= 0) {
- getline(cin, actor);
- if (actor == "ACTION") {
- break;
- }
- if (actor.length() <= 15) {
- cin >> salary;
- cin.ignore();
- budget -= salary;
- }
- else {
- budget *= 0.8;
- }
- }
- if (budget < 0) {
- printf("We need %.2f leva for our actors.\n", abs(budget));
- }
- else {
- printf("We are left with %.2f leva.\n", budget);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement