Advertisement
Visher

Untitled

Dec 10th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. int wylosowanaLiczba;
  2. bool powtorzylo;
  3. vector <int> wylosowaneLiczby;
  4.  
  5. for (int x = 0; x < 10; x++)
  6. {  
  7.     do
  8.     {
  9.         powtorzylo = false;
  10.         wylosowanaLiczba = rand() % 100;
  11.        
  12.         for (int y = 0; y < wylosowaneLiczby.size(); y++)
  13.             if (wylosowanaLiczba == wylosowaneLiczby[y])
  14.                 powtorzylo = true;
  15.     }
  16.     while (!powtorzylo)
  17.    
  18.     wylosowaneLiczby.push_back(wylosowanaLiczba);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement