Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int target, sum = 0;
- cin >> target;
- string service, category;
- while (target > sum) {
- cin >> service;
- if (service == "closed") {
- break;
- }
- cin.ignore();
- getline(cin, category);
- if (service == "haircut") {
- if (category == "mens") {
- sum += 15;
- }
- else if (category == "ladies") {
- sum += 20;
- }
- else if (category == "kids") {
- sum += 10;
- }
- }
- else if (service == "color") {
- if (category == "touch up") {
- sum += 20;
- }
- else if (category == "full color") {
- sum += 30;
- }
- }
- }
- if (sum >= target) {
- cout << "You have reached your target for the day!\n";
- }
- else {
- cout << "Target not reached! You need " << target - sum << "lv. more.\n";
- }
- cout << "Earned money: " << sum << "lv.\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement