1 #include<stdio.h> 2 3 int a[8] = {0}; 4 void main(){ 5 int i; 6 int num,data; 7 printf("please input 7 number:"); 8 for(i = 0;i < 7;i++) 9 { 10 //printf("please input di%d number:", i+1); 11 scanf("%d",&a[i]); 12 } 13 // printf("please input one weizhi number:"); 14 // scanf("%d",&number); 15 // printf("please input one weizhi number:"); 16 // scanf("%d",&data); 17 printf("please input you want insert position and data:"); 18 scanf("%d%d",&num , &data); 19 for (i =7;i > num-1;i--){ 20 a[i] = a[i-1]; 21 } 22 a[num-1] = data; 23 24 for(i = 0;i < 7;i++) 25 { 26 printf("%d ",a[i]); 27 } 28 printf("\n"); 29 return; 30 }