fork download
  1. #include <stdio.h>
  2.  
  3. void printA(int a[],int n){
  4. int i;
  5. for(i=0;i<n;i++){
  6. printf("%d",a[i]);
  7. }
  8. printf("\n");
  9. }
  10.  
  11.  
  12. void swap(int *a,int *b){//a,bはそれぞれ*a,*bの住所を表す
  13. int x;
  14. x=*a;//xはaの住所に入っている数を表す
  15. *a=*b;//bの住所に入っている数をaの住所に入っている数に上書きする
  16. *b=x;//aの住所に入っている数(x)をbの住所に入っている数に上書きする
  17. }//これで入れ替えが完了
  18.  
  19.  
  20. void reverse(int a[],int n){
  21. int i;
  22. for(i=0;i<n/2;i++){
  23. swap(&a[i],&a[n-i-1]);
  24. }
  25. }
  26. int main(void) {
  27. // your code goes here
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty