i = i * sign; sum = sum + i ; sign = -sign;和 sum = sum + i * sign ; sign = -sign;有什么区别

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 01:11:39
i=i*sign;sum=sum+i;sign=-sign;和sum=sum+i*sign;sign=-sign;有什么区别i=i*sign;sum=sum+i;sign=-sign;和sum=sum

i = i * sign; sum = sum + i ; sign = -sign;和 sum = sum + i * sign ; sign = -sign;有什么区别
i = i * sign; sum = sum + i ; sign = -sign;和 sum = sum + i * sign ; sign = -sign;有什么区别

i = i * sign; sum = sum + i ; sign = -sign;和 sum = sum + i * sign ; sign = -sign;有什么区别
前者运行后i的值变了,后者运行后i的值没变,其余的无区别.