if語句后是否可以忽略{}
#include <stdio.h>
int main()
{
??? int sum = 0;
??? int i;
??? for(i=1; i<=10; i++)
??? {
??????? printf("%d\n", i);
??????? if(i==3)??????????????????? //是不是少了一個判斷呢?
??????? goto HERE;??????????????????? //在這里使用goto語句
??? }
??? HERE:printf("結(jié)束for循環(huán)了....\n");? //請選擇合適位置添加標(biāo)識符
??? return 0;?? ?
}
2018-01-23
if(條件表達(dá)式)
{
//如果這里只有一條語句,可以省略{}
sum=a+b;//整個{}體內(nèi)就這一條語句,{}可以省略
}
2018-01-22
單行語句可以
2018-01-22
可以,我試過,但還是加上好,不然會出現(xiàn)不知道的錯誤。
2018-01-22
應(yīng)該不行
2018-01-22
不可以