Advertisement
Spocoman

Movie Profit

Sep 20th, 2023 (edited)
1,292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string movie;
  8.     getline(cin, movie);
  9.  
  10.     int days, tickets;
  11.     cin >> days >> tickets;
  12.  
  13.     double ticketPrice;
  14.     cin >> ticketPrice;
  15.  
  16.     int percent;
  17.     cin >> percent;
  18.  
  19.     double price = days * tickets * ticketPrice * (100 - percent) / 100;
  20.  
  21.     printf("The profit from the movie %s is %.2f lv.", movie.c_str(), price);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement