Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- int tab [10];
- for (int i=0;i<10;i++)
- {
- int flaga=0;
- do
- {
- tab[i]=(rand()%15)+1;
- for (int j=0;j<i;j++)
- {
- if(tab[i]==tab[j])
- {
- flaga=1;
- }
- }
- }
- while(flaga==1);
- cout<<tab[i]<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement