| 30 | } |
| 31 | |
| 32 | int FastestCar() |
| 33 | { |
| 34 | int max = -1; |
| 35 | int maxId = -1; |
| 36 | for(int i = 0; i < 3; ++i) { |
| 37 | auto* car = CreateCar(i); |
| 38 | |
| 39 | if(car->speed() > max) { |
| 40 | max = car->speed(); |
| 41 | maxId = i; |
| 42 | } |
| 43 | |
| 44 | delete car; |
| 45 | } |
| 46 | |
| 47 | return maxId; |
| 48 | } |
| 49 | |
| 50 | int main() |
| 51 | { |