Facebook
From Sharp Mockingjay, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 224
  1. void por(wel *p, wel *q)
  2. {
  3.         wel n=*p, m=*q;
  4.         wel a=NULL,b=NULL;
  5.         if(n!=NULL && m!=NULL)
  6.         {
  7.                         while(n!=NULL)
  8.                         {
  9.                                 int k=0;
  10.                                 while(m!=NULL)
  11.                                 {
  12.                                         if(n->x == m->x) k++;
  13.                                         m=m->nast;
  14.                                 }
  15.                                 m=*q;
  16.                                 if(k==0)
  17.                                 {
  18.                                         a=dodpocz(a,n->x);
  19.                                 }
  20.                                 n=n->nast;
  21.                         }
  22.                        
  23.                         m=*q;
  24.                         n=*p;
  25.                        
  26.                         while(m!=NULL)
  27.                         {
  28.                                 int k=0;
  29.                                 while(n!=NULL)
  30.                                 {
  31.                                         if(m->x == n->x) k++;
  32.                                         n=n->nast;
  33.                                 }
  34.                                 n=*p;
  35.                                 if(k==0)
  36.                                 {
  37.                                         b=dodpocz(b,m->x);
  38.                                 }
  39.                                 m=m->nast;
  40.                         }
  41.                        
  42.                         while(n!=NULL)
  43.                         {
  44.                                 wel r;
  45.                                 r=n;
  46.                                 n=n->nast;
  47.                                 free(r);
  48.                         }
  49.                        
  50.                         while(m!=NULL)
  51.                         {
  52.                                 wel r;
  53.                                 r=m;
  54.                                 m=m->nast;
  55.                                 free(m);
  56.                         }
  57.                         *p=a;
  58.                         *q=b;
  59.         }
  60. }