fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string RacerName;
  6. int CheckpointOne;
  7. int CheckpointTwo;
  8. int CheckpointThree;
  9. int CheckpointFour;
  10.  
  11. cout << "Enter the racer's first name: ";
  12. cin >> RacerName;
  13.  
  14. cout << "Enter the time (in minutes) at checkpoint 1: ";
  15. cin >> CheckpointOne;
  16. cout << "\nEnter the time (in minutes) at checkpoint 2: ";
  17. cin >> CheckpointTwo;
  18. cout << "\nEnter the time (in minutes) at checkpoint 3: ";
  19. cin >> CheckpointThree;
  20. cout << "\nEnter the time (in minutes) at checkpoint 4: ";
  21. cin >> CheckpointFour;
  22.  
  23. cout << "\nTimes for " << RacerName <<
  24. ": CP1: " << CheckpointOne << " CP2: " << CheckpointTwo <<
  25. " CP3: " << CheckpointThree << " CP4: " << CheckpointFour << '\n';
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 3464KB
stdin
Fred
1
10
12
15
stdout
Enter the racer's first name: Enter the time (in minutes) at checkpoint 1: 
Enter the time (in minutes) at checkpoint 2: 
Enter the time (in minutes) at checkpoint 3: 
Enter the time (in minutes) at checkpoint 4: 
Times for Fred: CP1: 1 CP2: 10 CP3: 12 CP4: 15