Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include "Nagłówek.h"
- int main() {
- List* lista = new List;
- std::fstream plik;
- std::string slowo[3];
- plik.open("H:\data3.txt", std::ios::in | std::ios::out);
- if (plik.good()==true) {
- std::string linia;
- std::string przerywnik = ", ";
- while (!plik.eof()) {
- size_t pos = 0;
- int i = 0;
- getline(plik, linia);
- while ((pos = linia.find(przerywnik)) != std::string::npos) {
- slowo[i] = linia.substr(0, pos);
- linia.erase(0, pos + przerywnik.length());
- i += 1;
- }
- pos = linia.find(",");
- linia = linia.substr(0, pos);
- lista->add(slowo[0],stoi(slowo[1]),slowo[2],linia);
- }
- }
- plik.close();
- std::string country = "England";
- lista->show_country(country);
- std::cout << std::endl;
- lista->show_country("France");
- std::cout << std::endl;
- lista->show_clubs_winners();
- std::cout << std::endl;
- lista->show_year(1982);
- lista->show_year(1966);
- lista->show_year(1956);
- delete lista;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement