Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct Players {
- string name;
- string surname;
- string position;
- int age;
- int number;
- };
- struct Team {
- string name;
- int pos;
- };
- struct League {
- string name;
- int division;
- Team teams[24];
- int noClubs=0;
- void print()
- {
- cout << "Division: " << division << endl;
- cout << "League Name: " << name << endl;
- }
- void clubLeague(Team t)
- {
- teams[24] = t;
- noClubs++;
- }
- };
- struct Countries {
- string name;
- League leagues[2];
- int noLeagues = 0;
- Countries(string n) {
- name = n;
- }
- void leaguestate(League l)
- {
- leagues[noLeagues] = l;
- noLeagues++;
- }
- void print()
- {
- cout << "Country: " << name << endl;
- for (int i = 0; i < noLeagues; i++)
- leagues[i].print();
- cout << "-------------------" << endl;
- }
- };
- /*struct Players {
- string name;
- string surname;
- string position;
- int age;
- int number;
- };*/
- int main() {
- Countries england("England");
- Countries spain("Spain");
- Countries macedonia("Macedonia");
- League epl1{ "English Premier League",1 };
- League epl2{ "English Championship",2 };
- League laliga{ "La Liga Santander",1 };
- League secunda{ "Secunda Division",2 };
- League league1{ "First League",1 };
- League league2{ "Second League",2 };
- Team liverpool{ "Liverpool", 1 };
- Team mancity{ "Manchester City", 2 };
- Team tottenham{ "Tottenham",3 };
- Team arsenal{ "Arsenal", 4};
- Team manunited{ "Manchester United", 5 };
- Team chelsea{ "Chelsea",6 };
- Team wolves{ "Wolves", 7 };
- Team watford{ "Watford", 8 };
- Team westham{ "West Ham",9 };
- Team leicester{ "Leicster City", 10 };
- Team everton{ "Everton",11 };
- Team bournemouth{ "Bournemouth", 12 };
- Team newcastle{ "Newcastle", 13 };
- Team crystalpalace{ "Crystal Palace", 14 };
- Team brighton{ "Brighton",15 };
- Team southhampton{ "Southhampton", 16 };
- Team burnley{ "Burnley",17 };
- Team cardiff{ "Cardiff", 18 };
- Team fulham{ "Fulham", 19 };
- Team huddersfield{ "Huddersfield", 20 };
- epl1.clubLeague(liverpool);
- //futja e ligave ne shtete
- england.leaguestate(epl1);
- england.leaguestate(epl2);
- spain.leaguestate(laliga);
- spain.leaguestate(secunda);
- macedonia.leaguestate(league1);
- macedonia.leaguestate(league2);
- epl1.clubLeague(chelsea);
- string n;
- cout << "Football leagues" << endl;
- cout << "Choose country to see the leagues: " << endl;
- cout << "1.England " << endl;
- cout << "2.Spain " << endl;
- cout << "3.Macedonia" << endl;
- cin >> n;
- if ((n == "England") || (n == "england"))
- {
- england.print();
- }
- else
- if ((n == "Spain") || (n == "spain"))
- {
- spain.print();
- }
- else
- if ((n == "Macedonia") || (n == "macedonia"))
- {
- macedonia.print();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement