Facebook
From Ryuujin, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 716
  1. struct lista
  2. {
  3.         lista *Next;
  4.         int Zaw;
  5. }
  6.  
  7. lista * Dodaj(lista *Where, int Co)
  8. {
  9.         while(Where!=0)
  10.         Where = Where->Next;
  11.        
  12.         Where = malloc(sizeof(lista));
  13.         Where->Zaw = Co;
  14.         Where->N = 0;
  15.     return Where;
  16. }
  17.  
  18. int Zlicz(lista *Where)
  19. {
  20.         int B = 0;
  21.         while(Where!=0)
  22.     {
  23.         B++;
  24.                 Where=Where->Next;
  25.         }
  26.    
  27.     return B;
  28. }
  29.  
  30. lista *Zwroc(lista *Where, int Poz)
  31. {
  32.         while(Poz>0 && Where != 0)
  33.     {
  34.         Poz --;
  35.         Where = Where->Next;
  36.         }
  37.    
  38.     return Where;
  39. }