您的位置:首页 > 其它

第9周 项目6-5 任务分配

2014-10-31 16:29 204 查看
问题及代码:

/*。
*Copyright(c)2014,烟台大学计算机学院
*All right reserved,
*文件名:test.cpp
*作者:liu_feng_zi_
*完成日期:2014年10月30日
*版本号:v1.0
*
问题描述:任务分配
*输入描述:
*程序输出:
*/
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f,count=0;
for(a=0; a<=1; a++)
for(b=0; b<=1; b++)
for(c=0; c<=1; c++)
for(d=0; d<=1; d++)
for(e=0; e<=1; e++)
for(f=0; f<=1; f++)
if(a+b>=1&&(a+d)!=2&&a+e+f==2&&(b+c==0||b+c==2)&&c+d==1&&(d+e==0||d==1))

{
count++;
cout<<"方案:"<<count<<endl;
cout<<"A:"<<a<<endl;
cout<<"B:"<<b<<endl;
cout<<"C:"<<c<<endl;
cout<<"D:"<<d<<endl;
cout<<"E:"<<e<<endl;
cout<<"F:"<<f<<endl;
}

return 0;
}


运行结果:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: