基于c++的猜拳游戏.docVIP

  • 43
  • 0
  • 约7.1千字
  • 约 13页
  • 2017-11-26 发布于河南
  • 举报
基于c的猜拳游戏

#includeiostream #include stdlib.h #include time.h using namespace std; void show(int input) { switch(input) { case 1:cout(出的是石头!); break; case 2:cout(出的是剪刀!); break; case 3:cout(出的是布!); break; default:; } } void compare(int inputPlay,int inputComputer) { if(inputPlay==1inputComputer==2||inputPlay==2inputComputer==3||inputPlay==3inputComputer==1) { cout(\n玩家胜!\n); } else if(inputPlay==inputComputer) { cout(\n平局!\n); } else { cout(\n电脑胜!\n); } } int main() { cout欢迎您玩 石头-剪子-布 游戏(游戏作者:张龙) 版本 1.0\nendl; cout请合理安排时间,切勿沉迷于游戏!\nendl; cout游戏说明:数字1代表石头

文档评论(0)

1亿VIP精品文档

相关文档