Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Nod {
- char nume [20];
- int h;
- Nod* leg;
- }*prim, *ultim, *p, *e[20];
- int main()
- {
- int n, i, j=1;
- cin>>n;
- e[20]=new Nod;
- prim=new Nod;
- ultim=new Nod;
- p=new Nod;
- for(i=1; i<=n; i++);
- {
- cout<<"Introduceti numele elevului: "<<endl; cin>>e[i]->nume;
- cout<<"Introduceti inaltimea elevului: "<<endl; cin>>e[i]->h;
- if(i!=n)
- e[i]->leg=e[i+1];
- else
- e[i]->leg=NULL;
- }
- while(e[j]!=NULL)
- {
- cout<<e[j]->nume<<" "<<p[j]->h<<" ";
- e[j]=e[j]->leg;
- j++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement