fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5.  
  6. int main()
  7. {
  8. printf("Массив до:\n");
  9. int length=30;
  10. int A[length];
  11. int i, j, Xmin = -1000, Xmax = 1000;
  12. srand(time(NULL));
  13. for (i=0; i<length; i++)
  14. {
  15. A[i]= - 1000 + rand()%(Xmax - Xmin +1);
  16. printf ("%d " , A[i]);
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Массив до:
-666 -656 -227 149 -101 -494 -887 -82 538 -920 -402 97 639 -370 -313 -208 -775 646 181 952 352 224 -761 -578 312 -579 -314 -355 -499 826