C語言程式設計問題 - Play

Table of Contents

以Divideandconquer的概念,設計一個能跟電腦進行5/10/15數字拳划拳遊戲雙方猜拳(ex.剪刀石頭布),由贏的人先喊0.5.10.15.20數字當喊出來的數字等於兩人手指表示的數目總和,那麼喊出來的人可再喊一次,如果再喊一次數字的數目又等於兩人手指表示的數目總和,那麼喊的人就贏了當喊出來的數字等於不等於兩人手�

All Comments

Thomas avatarThomas2011-05-15
#include#include#includeusingnamespacestd;intMora(intplayerData){stringsComputer[3]={"剪刀","石頭","布"};enum{emTie=0,emYouWin=1,emYouLose=2};intiResult=0;intiComputerData=0;srand(time(NULL));iComputerData=(rand()%3);stringstr=sComputer[playerData].c_str();cout<<"你出"<