Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <time.h>
- int main()
- {
- int t, i, j, k, l, a, b, c, d, x, y, z, n, flag = 0, ar[300];
- char str[1000], str2[1000];
- freopen("numbers.txt", "w", stdout);
- srand(time(0));
- for (i = 0; i < 100;)
- {
- y = 0, x = (rand() % 200) + 1;
- for (l = 0; l < i; l++)
- {
- if (ar[l] == x)
- {
- y = 1;
- break;
- }
- }
- if (y == 0) ar[i++] = x;
- }
- for (l = 0; l < i; l++) printf("%d\n", ar[l]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement