Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5.  
  6. int main ()
  7. {
  8. int i,k,n;
  9. scanf("%d",&n);
  10. int a [n];
  11.  
  12. srand(time(NULL));
  13.  
  14. for(i=0;i<n;i++)
  15. {
  16. a[i]= (rand() % 3)-1;
  17.  
  18.  
  19. printf("%d\n",a[i]);
  20. }
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement