Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double record, distance, secondsToMeter;
- cin >> record >> distance >> secondsToMeter;
- double score = distance * secondsToMeter + floor(distance / 15) * 12.5;
- cout.setf(ios::fixed);
- cout.precision(2);
- if (score >= record) {
- cout << "No, he failed! He was " << score - record << " seconds slower." << endl;
- }
- else {
- cout << "Yes, he succeeded! The new world record is " << score << " seconds." << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement