新手求大大解释下面2个程序式子
程序代码:#include<stdio.h>
int main(void)
{
int num_lie = 3;
int candy = 10;
if(num_lie == 0)
{
candy *= 2;
}
else if(num_lie == 1)
{
candy /= 2;
}
else
{
candy = 0;
}
printf("the number of candy is : %d\n",candy);
return 0;
}
#include<stdio.h>
int main(void)
{
int num_lie = 0 ;
int candy = 10;
if(num_lie)
{
candy *= 2;
}
else if(num_lie)
{
candy /= 2;
}
else
{
candy = 0;
}
printf("the number of candy is : %d\n",candy);
return 0;
}这2个源代码表示不同,但是结果都是一样,本人脑海里有一点思路,就是关于逻辑真假关系的,但是又有点模糊,请大家能讲的详细点。谢谢







