Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int tab[10];
  8. int tab1[10];
  9. int indextab1 = 0;
  10.  
  11. for (int i = 0; i < 10; i++) {
  12. cin >> tab[i];
  13. }
  14. for (int i = 0; i < 10; i++) {
  15. bool znajdujesie = false;
  16. for (int j = 0; j < indextab1; j++) {
  17. if (tab[i] == tab1[j]) {
  18. znajdujesie = true;
  19. }
  20. }
  21. if (!znajdujesie) {
  22. tab1[indextab1++] = tab[i];
  23. cout << tab[i] << " ";
  24. }
  25. }
  26.  
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement