Advertisement
toan9xpro2012

C1 C2

Nov 11th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. int Xoa_5(List *L){
  2.     Position p;
  3.     p = FirstList(*L);
  4.     while (p!=EndList(*L)){
  5.         if (Retrieve(p,*L)%5 == 0){
  6.             Delete_List(p,L);
  7.             p--;
  8.         }
  9.         p=Next(p,*L);
  10.     }
  11. }
  12.  
  13. int tangdan(List L){
  14.     Position p;
  15.     p = FirstList(L);
  16.     p = Next(p,L);
  17.     while (p!=EndList(L)){
  18.         if (Retrieve(p,L)<Retrieve(p-1,L)){
  19.             return false;
  20.         }
  21.         p=Next(p,L);
  22.     }
  23.     return true;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement