Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AlegeZeceIntrebari()
- {
- nrIntrebari = L.Count;
- a = new Intrebare[11];
- Random w = new Random();
- int[] t = new int[11];
- int k = 0; // Cate intrebari distincte am ales
- while (k < 10)
- {
- int p = w.Next(nrIntrebari);
- int gasit = 0;
- for (int i = 1; i <= k; i++)
- if (t[i] == p) gasit = 1;
- if (gasit == 0) t[++k] = p;
- }
- for (int i = 1; i <= 10; i++)
- a[i] = L[t[i]];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement