int main(int argc, char** argv) { Years years; Years::Record* record_year; Results results; Results::Record* record_result; Stat stat_table; Clubs clubs; string path; if (argc > 1) { path = argv[1]; } else { path = "./data"; } ResultsDB::init(path); if (!years.open()) return EXIT_FAILURE; while ((record_year = years.next()) != NULL) { results.open(record_year->file_results); while ((record_result = results.next()) != NULL) { stat_table.add(record_result); } results.close(); } years.close(); vector<Stat::Record*>* v = stat_table.get_sorted_vector_by_default(); vector<Stat::Record*>::const_iterator iter; int place = 0; for (iter = v->begin(); iter != v->end(); ++iter) { place++; int w = ((*iter)->w1 + (*iter)->w2); int d = ((*iter)->d1 + (*iter)->d2); int l = ((*iter)->l1 + (*iter)->l2); int f = ((*iter)->f1 + (*iter)->f2); int a = ((*iter)->a1 + (*iter)->a2); cout << place << " " << clubs.get_latest_club_name((*iter)->team_id) << " " << (w + d + l) << " " << w << " " << d << " " << l << " " << f << ":" << a << " " << (2 * w + d) << " " << (*iter)->unknown << "?" << endl; } return (EXIT_SUCCESS); }