Advertisement
Spocoman

Movie Day

Sep 20th, 2023
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int movieTime, scene, sceneTime;
  8.     cin >> movieTime >> scene >> sceneTime;
  9.  
  10.     double total = 0.15 * movieTime + scene * sceneTime;
  11.  
  12.     if (total >= movieTime) {
  13.         cout << "Time is up! To complete the movie you need " << round(total - movieTime) << " minutes.\n";
  14.     }
  15.     else {
  16.         cout << "You managed to finish the movie on time! You have " << round(movieTime - total) << " minutes left!\n";
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement