#include
void abc(int ,int );
void def(int ,int );
void main()
{int a,b,e=1,f=2; /*开始界面部分*/
printf("1start\n");
printf("2over\n");
scanf("%d",&a);
b=a;
switch(a=b)
{case 1:abc(e,f);break;
case 2:printf("game over,wlcome to next play");}}
void abc(int a,int b)
{int c=0,d=0,e=3,f=4;
printf("1上朝\n");
printf("2御书房\n");
printf("3寝室\n"); /*任务路径选择部分*/
printf("4后宫\n");
printf("5后花园\n");
scanf("%d",&c);
c=d;
switch(c==d)
{case 1:def(e,f);break;
case 2:printf("good");}}
void def(int a,int b)
{int c,d,e=50,f=100,g=80,h=10,i=100,j=400,k=200,l=500,m=400,n=600,o=1000,p=300,q=0,r=800,s=2,t=1,u=700,v=1,w=2,s=0;
printf("吾王万岁万万岁\n");
printf("请问皇上要查询哪个部门\n"); /*任务选择分支*/
printf("1军团\n2建筑部\n3军团资源部\n4人力资源部\n5退朝\n");
do
{scanf("%d",&c);
d=c;
switch(c=d)
{case 1:printf("士兵人数%d万\n弓箭手人数%d万\n火枪兵人数%d万\n重甲兵人数%d万\n",e,f,g,h);
case 2:printf("工人%d万\n木头%d万\n石头%d万\n",i,j,k);
case 3:printf("刀%d万\n火枪%d万\n弓箭%d万\n轻甲%d万\n重甲%d万\n",l,m,n,o,p);
case 4:printf("工人%d万\n大臣%d万\n军官%d万\n备用士兵%d万\n,r,s,t,u");}}
while(q=s);}
warning C4145: '==' : relational expression as switch expression; possible confusion with '='
D:\game01\0101.cpp(24) : warning C4808: case '2' is not a valid value for switch condition of type 'bool'
D:\game01\0101.cpp(26) : error C2374: 's' : redefinition; multiple initialization
D:\game01\0101.cpp(26) : see declaration of 's'
执行 cl.exe 时出错.
0101.obj - 1 error(s), 0 warning(s)