G2A Many GEOs
SHARE
TWEET

WorldRecord

JOHNYTHEWINNER Jan 23rd, 2020 (edited) 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # include <iostream>
  2. using namespace std;
  3. #include <iomanip>
  4. #include <math.h>
  5. #include <cmath>
  6.  
  7. int main()
  8. {
  9.     double worldrecord;
  10.     double meters;
  11.     double time;
  12.  
  13.     do
  14.     {
  15.         cin.clear();
  16.         cin >> worldrecord;
  17.     }
  18.     while (cin.bad() || worldrecord < 0 || worldrecord> 100000);
  19.  
  20.     do
  21.     {
  22.         cin.clear();
  23.         cin >> meters;
  24.     }
  25.     while (cin.bad() || meters <  0 || meters> 100000);
  26.  
  27.     do
  28.     {
  29.         cin.clear();
  30.         cin >> time;
  31.     }
  32.     while (cin.bad() || time < 0 || time> 1000);
  33.  
  34.     double speed = 1 / time;
  35.     double slow = floor(meters / 15);
  36.     double newtime = (meters / speed)+ (slow*12.5);
  37.     if (newtime < worldrecord)
  38.     {
  39.         cout << "Yes, he succeeded! The new world record is " << fixed << setprecision(2) << newtime << " seconds." << endl;
  40.     }
  41.     if (newtime >= worldrecord)
  42.     {
  43.         cout << "No, he failed! He was " << fixed << setprecision(2) << (newtime-worldrecord) << " seconds slower." << endl;
  44.     }
  45.  
  46.        
  47.          
  48.     return 0;
  49. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top