#include <stdio.h> #include <stdlib.h> void reverse(int * origin, int num){ for(int i = 0; i < num / 2; i ++){ int trans = 0; trans = *(origin + i); *(origin + i) = *(origin + num - i - 1); *(origin + num - i - 1) = trans; } } int main(){ int * all = malloc(sizeof(int) * 100); int cnt = 0; for(int i = 0;i < 10;i ++){ scanf("%d", all + i); cnt ++; } * (all + cnt) = 0; reverse(all, cnt); for(int i = 0; i < cnt; i ++){ printf("%d ", * (all + i)); } printf("\n"); }