#include<stdio.h> void sway(int* left,int* right) { while(left < right) { int tmp = *left; *left = *right; *right = tmp; left++; right--; } } int main() { int arr[10]; int i = 0; for(i = 0;i<10;i++) scanf("%d ",&arr[i]); int size = sizeof(arr)/sizeof(arr[0]); sway(arr,arr+size-1); for(i = 0;i<10;i++) printf("%d ",arr[i]); return 0; }