1234567891011121314
1. Cars: AA11 Hours: 2 2. Cars: BB22 Hours: 4 3. Cars: CC33 Hours: 6 4. Cars: DD44 Hours: 8 5. Cars: EE55 Hours: 10
123456789101112131415
#include<iostream.h> void main () { char cname[5]; int n, hour; for (n=1; n<=5; n++) { cout << n << ". Cars: "; cin.getline(cname, 5); cout << "Hours: "; cin >> hour; cout << endl; } }
123456789
1. Cars: AA11 Hours: 2 2. Cars: Hours: BB22 3. Cars: Hours: 4. Cars: Hours: 5. Cars: Hours: Press any key to continue_