Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int c = 8;
- int cegsorszam[8] = {1, 1, 3, 5, 1, 4, 3, 2};
- int segedtomb[8];
- for(int i=0; i<c; ++i)
- segedtomb[i] = 101;
- int p = 0;
- int y = 0;
- for(int i=0; i<c; ++i)
- {
- p = 0;
- for(int j=0; j<y; ++j)
- if(cegsorszam[i] == segedtomb[j])
- ++p;
- if(p==0)
- {
- segedtomb[y] = cegsorszam[i];
- ++y;
- }
- }
- for(int i=0; i<y; ++i)
- cout << segedtomb[i] << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement