Advertisement
Guest User

iogha ui

a guest
Sep 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. struct nod{
  5. int inf;
  6. nod *next;
  7. };
  8. void add_sf(nod*&p,nod*&u,int val)
  9. {
  10. if(!p){
  11. p=u=new nod;
  12. p->inf=val;
  13. pp->next=NULL;
  14. }
  15.  
  16. else{
  17. u->next=new nod;
  18. u->inf=val;
  19. u->next=NULL;
  20. }
  21. }
  22. int main()
  23. {
  24. nod *p,*u;
  25. p=NULL;
  26. for(int i=0; i<=5; i++)
  27. add_sf(p,u,i);
  28. return 0;
  29. }
  30. #include <iostream>
  31.  
  32. using namespace std;
  33. struct nod{
  34. int inf;
  35. nod *next;
  36. };
  37. void add_sf(nod*&p,nod*&u,int val)
  38. {
  39. if(!p){
  40. p=u=new nod;
  41. p->inf=val;
  42. pp->next=NULL;
  43. }
  44.  
  45. else{
  46. u->next=new nod;
  47. u->inf=val;
  48. u->next=NULL;
  49. }
  50. }
  51. int main()
  52. {
  53. nod *p,*u;
  54. p=NULL;
  55. for(int i=0; i<=5; i++)
  56. add_sf(p,u,i);
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement