Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "Sorts.c"
  4.  
  5. int main()
  6. {
  7. int *a;
  8. int N;
  9. printf("Введите количество элементов в массиве\n");
  10. scanf("%d",&N);
  11. a = malloc(N * sizeof(int));
  12. for (int i = 0; i < N; i++)
  13. {
  14. a[i] = rand();
  15. }
  16. qsort(a, 0 ,N - 1);
  17. for (int i = 0; i < N; i++)
  18. {
  19. printf("%d ",a[i]);
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement