条件中的任何两个条件都是正确的 [英] Any two of the condition is true how excute astatement
本文介绍了条件中的任何两个条件都是正确的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有4个条件,分别是A,B,C,D.
如果四分之二是正确的,那么任何onw pls如何建议我给它一个解决方案...
Hi,
I have 4 conditions say A,B,C,D.
If any two in 4 is true how excute a statement any onw pls suggest me a solution for it...
推荐答案
hi,
使用以下过程:
Use below process:
int flag = 0;
if(a)
{
flag = flag+1;
}
if(b)
{
flag = flag+1;
}
if(c)
{
flag = flag+1;
}
if(d)
{
flag = flag+1;
}
if(flag >=2)
{
//Execute Statement
}
这篇关于条件中的任何两个条件都是正确的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文