Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<string>
- using namespace std;
- int main()
- {
- int stayOfDays;
- cin >> stayOfDays;
- string type, mark;
- cin >> type >> mark;
- double price = 0.0;
- if (type == "room for one person") {
- if (stayOfDays <= 10 && stayOfDays <= 15 && stayOfDays > 15) {
- price = stayOfDays * 18;
- }
- }
- else if (type == "apartment") {
- if (stayOfDays <= 10) {
- price = stayOfDays * 25 * 0.7;
- }
- else if (stayOfDays <= 15) {
- price = stayOfDays * 25 * 0.65;
- }
- else if (stayOfDays > 15) {
- price = stayOfDays * 25 * 0.5;
- }
- }
- else if (type == "president apartment") {
- if (stayOfDays <= 10) {
- price = stayOfDays * 35 * 0.9;
- }
- else if (stayOfDays <= 15) {
- price = stayOfDays * 35 * 0.85;
- }
- else if (stayOfDays > 15) {
- price = stayOfDays * 35 * 0.8;
- }
- }
- if (mark == "positive") {
- price *= 1.25;
- }
- else if (mark == "negative") {
- price *= 0.9;
- }
- cout << price << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement