Advertisement
toan9xpro2012

C4

Nov 11th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include "ALISTLIB.CPP"
  2. int Xoa_5(List *L){
  3.     Position p;
  4.     p = FirstList(*L);
  5.     while (p!=EndList(*L)){
  6.         if (Retrieve(p,*L)%5 == 0){
  7.             Delete_List(p,L);
  8.             p--;
  9.         }
  10.         p=Next(p,*L);
  11.     }
  12. }
  13.  
  14. int tangdan(List L){
  15.     Position p;
  16.     p = FirstList(L);
  17.     p = Next(p,L);
  18.     while (p!=EndList(L)){
  19.         if (Retrieve(p,L)<Retrieve(p-1,L)){
  20.             return false;
  21.         }
  22.         p=Next(p,L);
  23.     }
  24.     return true;
  25. }
  26.  
  27. int main(){
  28.     List Test;
  29.     Read_List(&Test);
  30.     Print_List(Test);
  31.     printf("\n");
  32.     Xoa_5(&Test);
  33.     Print_List(Test);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement