把循环内的:sum+=i++ 改为:sum+=i如下:main(){int n,sum=0,i;printf("\n please input n:");scanf("%d",&n);/****INSERT****/for(i=0;i<=n;i++){/****END****//****INSERT****/sum+=i;/****END****/}printf("\n result=%d",sum);}
sum+=i++;改为sum+=i;或者sum=sum+i