Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int toito(int a[], int s, int z, int z1)
- {
- for (int i = 0; i < s; i++)
- {
- int start = time(0);
- a[i] = rand() % (z1 - z) + z;
- //etykieta:
- for (int j = 0; j < i; j++)
- {
- if (a[i] == a[j])
- {
- a[i] = rand() % (z1 - z) + z;
- //goto etykieta;
- j = -1;
- continue;
- }
- int end = time(0);
- if (end - start > 2)
- {
- return i;
- }
- }
- }
- for (int i = 0; i < 20; i++)
- {
- printf("%d\n", a[i]);
- }
- return s;
- }
- void kolos1()
- {
- int a[20];
- int s;
- int z;
- int z1;
- printf("%d", toito(a, 20, 10, 30));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement