#include <stdio.h> int main(void) { int a[11] = {111,20,123,4543,556,34,5,54,43,234,53}; int i ; for(i=0;i<11;i++){ printf("%d\t",a[i]); } printf("\n"); for(i=0;i<=4;i++){ int tmp = a[i]; a[i]= a[10-i]; a[10-i] = tmp; } for(i=0;i<11;i++){ printf("%d\t",a[i]); } printf("\n"); int min=0; int max =10; while(min<max){ int tmp = a[min]; a[min] = a[max]; a[max] = tmp; min++; max--; } for(i=0;i<11;i++){ printf("%d\t",a[i]); } printf("\n"); return 0; }
时间: 2024-10-12 23:22:44