This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center。
6年前关闭。
我有下面的代码。但是,我认为答案是4。我对吗?
对于IF情况,a是a = 1还是a = 4?
6年前关闭。
我有下面的代码。但是,我认为答案是4。我对吗?
int a, i;
if (execute)
{
int count = 0;
for (i=0; i<5; i++)
{
if(pcnt[i]) count ++;
}
a = (count > 0)
}
else
{
a= 0;
}
对于IF情况,a是a = 1还是a = 4?
最佳答案
a
将是1
或0
1
:如果execute != 0
和count >0
0
:否则
注意:count >0
当且仅当pcnt[0]!=0
或pcnt[1]!=0
或pcnt[2]!=0
或pcnt[3]!=0
或pcnt[4]!=0
关于c - 此逻辑的输出是什么? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15637578/
10-11 03:22