#include #include #include using namespace std; struct student { string imie, nazwisko; double srednia; void odczyt(istream &s_we) { s_we >> imie >> nazwisko; double c =0.0; srednia = 0.0; while(1) { double ocena; s_we >>ocena; if(s_we.fail()) break; srednia += ocena; c++; } srednia = srednia/c; s_we.clear(); } }; int main() { ifstream s_we("lista.txt"); int linie = 0; if(!s_we.good()) { cout << "Nie ma pliku" << endl; system("pause"); return 0; } while(!s_we.eof()) { string temp; getline(s_we, temp); linie++; } s_we.clear(); s_we.seekg(0); student *studenci=new student[linie]; for (int i =0; i