I did this program and something is strange. isn't supposed the array start at index 0? why in my program it started at 1? I don't know how i did it. Could my IDE the one that made this "problem"?
Please help me understand what have a i done.
float time; //
cout << "Enter the time of the person number " << x << " : ";
cin >> time[x];
cout << "The person " << a << " was the faster.";
cout << time;
The index at 0 is preserved and still present. Your for loops don't start a zero, so change that and you'll be in business.
When you're iterating through a container, remember to start at the first index (which is always 0). Since you had x=1 and y=1, when you began iterating, it starts at the time in the array and leaves time.
You have a problem with your for loop at line 7.
You're looping 20 times, but the last time through the loop you storing into time. That's a problem. Your array goes from -. There is no time. You're likely to trash some memory you shouldn't.
How big are time time values? At line 5 you initialize first to 20. If all your time values are > 20, you'll never execute lines 16 and 17. When you get to line 21, a will be uninitialized.
At line 22, don't you want to print time[a] rather than time ?