计算过程?
i = 1; //重新初始化变量i
//do-while循环
do
{
i++;
sum+=i*flag;
flag*=-1;
}
while(i<=100);
printf("sum=%d\n",sum);
输出是-100,怎么改才能让输出变成-50,计算过程是怎样的?
i = 1; //重新初始化变量i
//do-while循环
do
{
i++;
sum+=i*flag;
flag*=-1;
}
while(i<=100);
printf("sum=%d\n",sum);
输出是-100,怎么改才能让输出变成-50,计算过程是怎样的?
2017-08-04
举报