#include <stdio.h>
main()
{ int a=2,b=-1,c=2;//初始化
if(a<b) //如果a<b 那么什么都不做,直接输出c
if(b<0) c=0;//如果b<0那么c等于0,否则c自增1
else c++;
printf("%d\n",c);输出结果,c=2
}
相当于
#include <stdio.h>
main()
{ int a=2,b=-1,c=2;//初始化
if(a<b) //如果a<b 那么什么都不做,直接输出c
{
if(b<0)//如果b<0那么c等于0,
{
c=0;
}
else //否则c自增1
{
c++;
}
}
printf("%d\n",c);//输出结果,c=2
}
温馨提示:答案为网友推荐,仅供参考