Advertisement
Guest User

ghkjh

a guest
Nov 15th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. int mess(int n){
  2.     int r, i;
  3.     static int mass[100];
  4.    
  5.     r = rand()%100 + 1;
  6.     if(i==0) {
  7.         mass[0] = r;
  8.     }
  9.    
  10.     else {
  11.         r = rand()%100 + 1;
  12.  
  13.         for(i=0;i<100;i++){ //цикл сравнения n-ного эл со всеми
  14.             if(mass[i]!=r&&i<n){
  15.             }
  16.            
  17.             else if(i = n){
  18.                 mass[n] = r;
  19.                 printf("%d", mass[n]);
  20.             }
  21.             else
  22.                 break;
  23.             }
  24.     }
  25. }
  26.  
  27.  
  28. int main() {
  29.     int i, n = 0;
  30.     for(i=0; i<=100; i++){
  31.         mess(n);
  32.         n++;
  33.         }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement