Advertisement
Spocoman

Final Competition

Sep 18th, 2023
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int dancers;
  8.     cin >> dancers;
  9.  
  10.     double points;
  11.     cin >> points;
  12.  
  13.     string season, destination;
  14.     cin >> season >> destination;
  15.  
  16.     double totalSum = dancers * points;
  17.  
  18.     if (destination == "Abroad") {
  19.         totalSum *= 1.50;
  20.         if (season == "summer") {
  21.             totalSum *= 0.90;
  22.         }
  23.         else {
  24.             totalSum *= 0.85;
  25.         }
  26.     }
  27.     else {
  28.         if (season == "summer") {
  29.             totalSum *= 0.95;
  30.         }
  31.         else {
  32.             totalSum *= 0.92;
  33.         }
  34.     }
  35.  
  36.     printf("Charity - %.2f\n", totalSum * 0.75);
  37.     printf("Money per dancer - %.2f\n", totalSum * 0.25 / dancers);
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement