rendered paste body#include <iostream>#include <fstream>#include <string>#include <cstdlib>using namespace std;struct Sstudent{ string Fimie; string Fnazwisko; int Frok; int Fkwota;};int main(){ int k; cin>>k; Sstudent *Sstud = new Sstudent[k]; //wczytaj(dane, n, Sstud); int i=0; int pozycja=0; string tmp; ifstream iplik; iplik.open("dane.txt"); if (iplik.good()) { while (!iplik.eof() && i<k) { getline(iplik, tmp); Sstud[i].Fimie = tmp; getline(iplik, tmp); Sstud[i].Fnazwisko = tmp; getline(iplik, tmp); Sstud[i].Frok = strtol(tmp.c_str(), NULL, 10); getline(iplik, tmp); Sstud[i].Fkwota = strtol(tmp.c_str(), NULL, 10); } } for (int a=0; a<5; a++) { cout<<Sstud[a].Fimie<<" "<<Sstud[a].Fnazwisko<<" "<<Sstud[a].Frok<<" "<<Sstud[a].Fkwota<<endl; } i=0; iplik.close(); ofstream oplik; oplik.open("wynik.txt"); if (oplik.good()) { while (i<k) { if (Sstud[i].Fkwota == 0) {oplik << Sstud[i].Fimie <<" "<< Sstud[i].Fnazwisko <<" "<< Sstud[i].Frok <<" "<< Sstud[i].Fkwota <<endl;} i++; } } oplik.close(); delete [] Sstud;return 0;}