void main()
{
int n =0;
int i = 0;
int sum =0;
printf("please input n:\n");
scanf("%d",&n);
if(n<=0)
{
printf("error ! n must >=1!\n");
return;
}
for(i=1;i<=n;i++)
{
sum = sum + i;
}
printf("the sum of 1+2+3+……+n is %d ",sum);
}
那不是在那个点放输入函数吗?
还是运行期间有输入就中断实行中断服务(实行输入函数)?
void main() { int n =0; int i = 0; int sum =0; printf(