Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Bilet 3
- **********************/
- #include<iostream> //teste
- #include<fstream>
- #include<string>
- using namespace std;
- class data{
- private:
- int z,l,a;
- string k;
- public:
- void init( ifstream &f ){ f>>z;}
- };
- class elev{
- private:
- int nr_mat;
- int an; //and de studii
- int grupa;
- string nume;
- string fac; //facultatea
- data *nascut;
- public:
- /* Format intrare : nr_matricol nume data_nasterii(z l an) facultatea and_de_studiu grupa */
- void init( ifstream &f ){ f>>nr_mat>>nume; nascut -> init(f); f>>fac>>an>>grupa; }
- };
- /* Lista Simplu Inlantuita */
- class lsi{
- public :
- elev e;
- lsi *urm;
- };
- void cit(ifstream &f, lsi *&start){
- lsi *c=new lsi, *j;
- while(!f.eof()){
- (c->e).init(f);
- c->urm=0;
- if(!start)
- start=c;
- else{
- for(j=start; j->urm; j=j->urm);
- j->urm=c;
- }
- }
- }
- void sub1a(lsi *&start1, lsi *&start2){
- lsi *c=new lsi,*j;
- ifstream fin1("elevi1.in");
- ifstream fin2("elevi2.in");
- cit(fin1, start1);
- cit(fin2, start2);
- }
- int main(){
- lsi *start1, *start2;
- start1=start2=0;
- sub1a(start1, start2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement