fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. const int sz = 10;
  7. int arr[sz] = {1, 1, 2, 3, 2, 2, 4, 5, 6, 2 };
  8. int cnt = 0;
  9. int count_iter = 0;
  10. for (int i = 0; i < sz; ++count_iter, i++)
  11. {
  12. for (int j = 0; j < sz; ++count_iter, j++)
  13. {
  14. if (arr[i] != arr[j])
  15. cnt++;
  16. }
  17. if (cnt == sz-1)
  18. cout << arr[i] << ' ';
  19. cnt = 0;
  20. }
  21. printf("Count_itet: %d\n", count_iter);
  22. }
  23.  
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
3 4 5 6 Count_itet: 110