所以我想要这个输出:
Position you wanted to insert
2
Value You wanted to insert
34
Array after insertion:
10 5 34 46 2 100 97
但它无法显示输出,我该怎么办请帮助我,并修复它..
#include <stdio.h>
#include <conio.h>
int main(){
int arr[100] = {10, 5, 46, 2, 100, 97};
int n, max, i;
n = 0;
clrscr();
if(i > n){
printf("postion you wanted to insert");
scanf("%d", &n);
}
printf("Value for position: \n");
scanf("%d", &max);
for(i=7; i>n-1; i--){
arr[i+1] = arr[i];
arr[n] = max;
}
printf("Array after insertion: \n");
for(i = 0; i < 7; i++){
printf("%d\t", arr[i]);
}
getch();
}