Guest User

Untitled

a guest
Dec 11th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #include <MassivSort.h>
  2. using namespace std;
  3. MassivSort::MassivSort(unsigned int n)
  4. {
  5. n_ = n;
  6. head = new Num_Massive();
  7. tail = head;
  8. for (int i = 1; i < n; i++)
  9. {
  10. if (i%10 == 0)
  11. {
  12. Num_Massive * buf = new Num_Massive();
  13. tail->next = buf;
  14. tail = buf;
  15. delete buf;
  16. }
  17. }
  18. tail->lngth = n%10+1;
  19. tail->next = NULL;
  20. }
  21. MassivSort::DeleteEl(unsigned int pos)
  22. {
  23. if (n_ == 1)
  24. {
  25. n_--;
  26. head = NULL;
  27. tail = NULL;
  28. return;
  29. }
  30. Num_Massive * buftail = head;
  31. for(int i = 1; i <= pos; i++)
  32. {
  33. if(i%10 == 0)
  34. {
  35. buftail = buftail->next;
  36. }
  37. }
  38. if (n_%10 == 1)
  39. {
  40.  
  41.  
  42. Num_Massive * buftail;
  43.  
  44. }
  45. else
  46. {
  47. for (; i<n_; i++)
  48. {
  49. if(i%10 == 0)
  50. {
  51. buftail = buftail->next;
  52. }
  53. }
  54. }
  55. n_--;
  56. }
  57. MyError::MyError(const char *s, int c)
  58. {
  59. code_=c;
  60. strncpy(message_, s, 100);
  61. }
Add Comment
Please, Sign In to add comment