Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- void mess() {
- int n, i, s = 0, r;
- static int mass[100];
- mass[0] = rand()%100 + 1;
- while(s != 1) {
- for(i=0; i<n; i++) {
- if(mass[i] == r) {
- r = rand()%100 + 1;
- }
- else
- s = 1;
- }
- }
- mass[n] = r;
- r = rand()%100 + 1;
- s = 0;
- for(i=0;i<100;i++) {
- printf("%d\n", mass[i]);
- }
- }
- int main() {
- mess();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement