fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define NUM 5
  5.  
  6. void intary_revcpy(int v1[], const int v2[], int n) {
  7. for (int i = 0; i < n; i++) {
  8. v1[i] = v2[n - 1 - i];
  9. }
  10. }
  11.  
  12. int main(void) {
  13. char a[NUM];
  14. int x1[NUM] = {0};
  15. for (int i = 0; i < NUM; i++) {
  16. scanf("%4s%*[^\n]", a);
  17. x1[i] = strtol(a, NULL, 10);
  18. }
  19. int x2[NUM] = {0};
  20. intary_revcpy(x2, x1, NUM);
  21. return EXIT_SUCCESS;
  22. }
  23.  
Success #stdin #stdout 0s 5556KB
stdin
Standard input is empty
stdout
Standard output is empty