我有这样的事情
一个布尔= TRUE;
布尔B =真实;
布尔积= TRUE;
如果(图)
{
如果一个)
{
如果(B)的
B = FALSE;
其他
B =真实;
//做一些有意义的东西在这里
}
//要执行一些东西在这里需要
}
我想打出来的if语句测试一个当B变成假的。有点像破发,并继续在循环中。有任何想法吗? 编辑:对不起,忘了,包括大的if语句。我想打出来,如果(一)当b是假的,但不是打出来的,如果(图)。
解决方案 如果(图)
{
如果一个)
{
B =!;
如果(B)的
{
//做一些有意义的东西在这里
}
}
//要执行一些东西在这里需要
}
I have something like this
bool a = true;
bool b = true;
bool plot = true;
if(plot)
{
if(a)
{
if(b)
b = false;
else
b = true;
//do some meaningful stuff here
}
//some more stuff here that needs to be executed
}
I want to break out of the if statement that tests a when b turns false. Kind of like break and continue in loops. Any ideas? Edit: sorry forgot to include the big if statement. I want to break out of if(a) when b is false but not break out of if(plot).
解决方案if(plot)
{
if(a)
{
b= !b;
if( b )
{
//do something meaningful stuff here
}
}
//some more stuff here that needs to be executed
}
上一篇:Android的 - 从下载Web图像,保存到内部存储器中的位置私下的应用程序,用于显示列表项应用程序、器中、图像、位置
下一篇:PostgreSQL里没有连接使用JDBC投掷org.postgresql.util.PSQLException到Android:连接尝试失败。org、JDBC、PostgreSQL、postgres