Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. setlocale(LC_ALL, "rus");
  2.  
  3. int n = 0, k;
  4. int mas[256];
  5. do
  6. {
  7. k = 0;
  8. cin>> mas[n];
  9. int check = mas[n];
  10. for (int i = 0; i < 256; i++)
  11. {
  12. if (mas[i] == check)
  13. k++;
  14. }
  15. n++;
  16. }
  17. while (k <= 1);
  18. cout << "Колличество элементов, которые не повторяются =" <<n-1<< "n";
  19.  
  20. int*ptrmas = mas;
  21. int* head = ptrmas;
  22. int*tail = ptrmas + n - 2;
  23.  
  24. if (*head == *tail)
  25. {
  26. cout << "Очередь пуста." << "n";
  27. }
  28.  
  29. else
  30. {
  31. if (*tail == 256)
  32. cout << "Очередь переполнена." << "n";}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement