问题描述
大家好,哪一个是嵌套if的结构?我的情况:
Hi guys, which one is the structure for a nested if? My case:
if((pippo ==" France")||(pippo ==" Brazil"))
if ((pippo=="France")||(pippo=="Brazil"))
{
if(lake ==" Yellow" || base ==" Red")
if (lake=="Yellow"||base=="Red")
{
消息框显示("酷")
}
其他
{
在SQL中插入数据的代码块
block of code to insert data in SQL
}
否则if((pippo ==" Usa" )||(pippo ==" Colombia"))
else if ((pippo=="Usa")||(pippo=="Colombia"))
{
if(lake ==" white" || base == "灰色")
if (lake=="White"||base=="Gray")
}
{
消息框显示("不冷却")
message box show ("No Cool")
}
else
{
代码块在SQL中插入数据
block of code to insert data in SQL
}
我想说,如果pippo是法国或巴西和湖是黄色的,基地是红色显示酷,否则触发sql代码。如果pippo是美国或哥伦比亚,湖是白色的,基地是灰色显示消息,否则触发sql
代码。
I am trying to say, if pippo is France or Brazil and the lake is yellow and the base is red show Cool otherwise trigger the sql code. If pippo is Usa or Colombia and the lake is white and the base is Gray show the message otherwise trigger thje sql code.
任何帮助?
Any Help?
推荐答案
if((pippo ==" France" || pippo ==" Brazil")&&(lake ==" Yellow" || base = ="红色"))
{
消息框显示("冷却")
}
其他
{
在SQL中插入数据的代码块
}
if( ( pippo == "France" || pippo == "Brazil" ) && ( lake == "Yellow" || base == "Red" ) )
{
message box show ("Cool")
}
else
{
block of code to insert data in SQL
}
if((pippo) ==" Usa" || pippo ==" Colombia")&&(lake ==" White" || base ==" Gray"))
{
消息框显示("不冷却")
}
其他
{
    在SQL中插入数据的代码块
}
if( ( pippo == "Usa" || pippo == "Colombia" ) && ( lake == "White" || base == "Gray" ) )
{
message box show ("No Cool")
}
else
{
block of code to insert data in SQL
}
或者这个:
if((pippo ==" France" || pippo ==" Brazil")&&(lake ==" Yellow" || base ==" Red"))
{
消息框显示("冷却")
}
其他 if((pippo ==" Usa" || pippo ==" Colombia")&&(lake ==" White" || base ==" Gray"))
{
消息框显示("不冷却")
}
其他
{
    在SQL中插入数据的代码块
}
if( ( pippo == "France" || pippo == "Brazil" ) && ( lake == "Yellow" || base == "Red" ) )
{
message box show ("Cool")
}
else if( ( pippo == "Usa" || pippo == "Colombia" ) && ( lake == "White" || base == "Gray" ) )
{
message box show ("No Cool")
}
else
{
block of code to insert data in SQL
}
这篇关于嵌套if中的C#帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!