1.双分支

/* Note:Your choice is C IDE */
#include "stdio.h"
void main()
{
int x=-1;
if(x==-1)
{
printf("真");
printf("真");
printf("真");
printf("真");
}
else
{
printf("假");
printf("假");
printf("假");
printf("假");
}

//if与else中间如果有2句以上,就必须用大括号括起来。
//只要圆括号内表达式为真,就执行if与else中间所有的代码,然后还会执行非else的代码。
//如果圆括号内表达式为假,就执行else后大括号内的所有代码,如果没有大括号,就执行离else最近的一句。
}

猜你喜欢

转载自www.cnblogs.com/wyj1212/p/9006368.html
1.