Advertisement
Spocoman

Skeleton

Sep 22nd, 2023
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int minutes, seconds;
  8.     cin >> minutes >> seconds;
  9.  
  10.     double lengthInMeters, secondsFor100Meters;
  11.     cin >> lengthInMeters >> secondsFor100Meters;
  12.  
  13.     int control = minutes * 60 + seconds;
  14.     double time = lengthInMeters / 100 * secondsFor100Meters - lengthInMeters / 120 * 2.5;
  15.  
  16.     if (time <= control) {
  17.         printf("Marin Bangiev won an Olympic quota!\nHis time is %.3f.\n", time);
  18.     }
  19.     else {
  20.         printf("No, Marin failed! He was %.3f second slower.", time - control);
  21.     }
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement