Advertisement
Guest User

New

a guest
Nov 15th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. void mess() {
  6.     int n, i, s = 0, r;
  7.     static int mass[100];
  8.    
  9.     mass[0] = rand()%100 + 1;
  10.    
  11.     while(s != 1) {
  12.         for(i=0; i<n; i++) {
  13.             if(mass[i] == r) {
  14.                 r = rand()%100 + 1;
  15.             }
  16.             else
  17.                 s = 1;
  18.         }
  19.     }
  20.    
  21.     mass[n] = r;
  22.     r = rand()%100 + 1;
  23.     s = 0;
  24.    
  25.     for(i=0;i<100;i++) {
  26.         printf("%d\n", mass[i]);
  27.     }
  28. }
  29.  
  30.        
  31.  
  32. int main() {
  33.     mess();
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement