为什么出现的是原来的编译运行的结果呢?
那位同志帮我指明一下。
把exe文件删除了,重新编译下
【相关推荐】
写法二就没有那么啰嗦了,直接上代码吧
#include<stdio.h>
int main(){
int i,j;
int temp;
int a[11]={1,4,6,9,13,16,19,28,40,100};
scanf("%d",&temp);
for(i = 9 ; i>= 0;i--){
if(temp<a[i])
a[i+1]=a[i];
else{
a[i+1]=temp;
break;
}
for(int i = 0;i<11;i++)
printf("%d ",a[i]);
printf("\n");
return 0;
}