c语言国王的许诺while,c语言编程的国王游戏请帮忙看看哪里错了

#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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值