int main() { srand(time(0)); int data[10]; for(int c=0;c<=9;c++) { bool found = false; while(!found) { data[c]=rand()%10+1; found=true; for(int r=0;r<c;r++) { if(data[c]==data[r]) found=false; } } } for(int c=0;c<=9;c++) cout << data[c] << endl; return 0; }
mikered159
source share