Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. void sort(list **begin) {
  2. list*temp = *begin;
  3. /*if (temp == NULL) {
  4. cout << "Нет данных\n" << endl;
  5. return;
  6. }*/
  7. list*temp1 = temp->next;
  8. list *t = *begin;
  9. list *next,*prev,*sh;
  10. for (int i = 0; i<2/*temp != NULL*/; i++) {
  11. int count = 0;
  12. while (temp1 != NULL) {
  13. if (temp->data1.Anumb == temp1->data1.Anumb)
  14. {
  15. count++;
  16. }
  17. temp->data1.count = count;
  18. //cout <<"\n"<< temp->data1.count << " ЭТО COUNT\n";
  19. //cout << temp->data1.Anumb << " ЭТО Число\n";
  20. temp1 = temp1->next;
  21. }
  22. sh = temp->next;
  23. prev = temp;
  24. next = sh->next;
  25. sh->next = prev;
  26. prev->next = next;
  27. }
  28. //cout << temp->data1.count << " всего count\n";
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement