Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct nod{
- int inf;
- nod *next;
- };
- void add_sf(nod*&p,nod*&u,int val)
- {
- if(!p){
- p=u=new nod;
- p->inf=val;
- pp->next=NULL;
- }
- else{
- u->next=new nod;
- u->inf=val;
- u->next=NULL;
- }
- }
- int main()
- {
- nod *p,*u;
- p=NULL;
- for(int i=0; i<=5; i++)
- add_sf(p,u,i);
- return 0;
- }
- #include <iostream>
- using namespace std;
- struct nod{
- int inf;
- nod *next;
- };
- void add_sf(nod*&p,nod*&u,int val)
- {
- if(!p){
- p=u=new nod;
- p->inf=val;
- pp->next=NULL;
- }
- else{
- u->next=new nod;
- u->inf=val;
- u->next=NULL;
- }
- }
- int main()
- {
- nod *p,*u;
- p=NULL;
- for(int i=0; i<=5; i++)
- add_sf(p,u,i);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement