daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Sep 22nd, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main(){
  7. double worldRecordsec;
  8. double distance;
  9. double timeinseconds;
  10. cin >>worldRecordsec>>distance>>timeinseconds;
  11. double allTime= distance *timeinseconds;
  12.  
  13. double resistance=floor(distance/15);resistance=resistance*12.50;
  14. double newRecord = allTime + resistance;
  15.  
  16. cout.setf(ios::fixed);
  17. cout.precision(2);
  18.  
  19. if (newRecord < worldRecordsec){
  20. cout <<"Yes, he succeeded! The new world record is "<<newRecord <<" seconds."<<endl;
  21.  
  22. } else {
  23. cout <<"No, he failed! He was "<< newRecord-worldRecordsec <<" seconds slower."<<endl;}
  24.  
  25. return 0;
RAW Paste Data
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