/* auto --> markanev,model tipus --> model neve,kiadas eve,motor tipusa motor --> motor tipusa[benzin/diesel/gaz],kobcenti,loero 3auto --> 100loero feletti es legidosebb */ #include #include #include using namespace std; struct motor { string motor; int kob; int loero; }; struct tipus { string mnev; int kiadas; motor mtipus; }; struct autoo{ string marka; tipus model; }; using namespace std; int main(int argc, char *argv[]) { int feletti[3]; int alatti[3]; int oreg[3]; int fiatal[3]; int min = 500; int max; autoo a[3]; for(int i = 0; i < 3; i++ ){ cout << "[" << i + 1 << "]Auto -> markaja[s]: "; cin >> a[i].marka; cout << "[" << i + 1 << "]Auto -> model -> neve[s]: "; cin >> a[i].model.mnev; cout << "[" << i + 1 << "]Auto -> model -> kiadas[i]: "; cin >> a[i].model.kiadas; cout << "[" << i + 1 << "]Auto -> model -> motor -> mtipus[s]: "; cin >> a[i].model.mtipus.motor; cout << "[" << i + 1 << "]Auto -> model -> motor -> kob[i]: "; cin >> a[i].model.mtipus.kob; cout << "[" << i + 1 << "]Auto -> model -> motor -> loero[i]: "; cin >> a[i].model.mtipus.loero; } system("cls"); cout << "adatok" << endl; for ( int i = 0; i < 3; i++ ) { cout << "Auto -> marka: "; cout << a[i].marka; cout< model -> neve[s]: "; cout << a[i].model.mnev; cout< model -> kiadas[i]: "; cout << a[i].model.kiadas; cout< model -> motor -> mtipus[s]: "; cout << a[i].model.mtipus.motor; cout< model -> motor -> kob[i]: "; cout << a[i].model.mtipus.kob; cout< model -> motor -> loero[i]: "; cout << a[i].model.mtipus.loero; cout< 100 ) { feletti[i] = i; } else { alatti[i] = i; } if ( a[i].model.kiadas > min ) { min = i; } } cout << endl << endl;; for ( int i = 0; i < 3; i++ ) { cout << "100loerotol nagyobbak: " << endl; cout << "Marka: " << a[feletti].marka << " Modell: " << a[feletti].model.mnev; cout << endl << endl; } cout << "Legidosebb: " << endl; cout << "Marka: " << a[min].marka << " Modell: " << a[min].modell.mnev; system("PAUSE"); return EXIT_SUCCESS; }