#include#include int main() { int r; int cost; int money; r = true; while(r) { printf("规则是:n玩家第一次摇骰子,如果摇出7点或12点,玩家胜,n玩家第一次如果摇出2点,3点,12点,则庄家胜,n玩家如果摇出其他点数则玩家继续摇骰子,n第二次如果玩家摇出7点,则庄家胜,如果玩家摇出第一次摇的点数,则玩家胜,n如果摇出其他点数则继续摇骰子,直到分出胜负n"); r = false; } printf("请输入你的当前持有金额:"); scanf_s("%d", &money); while(money>0) { printf("你的总资产为:%dn", money); int go_on = false; while (true) { printf("请下注:"); scanf_s("%d", &cost); if (cost>0 and cost<=money) { break; } } int first; first = (1 + (rand() % 6)) + (1 + (rand() % 6)); printf("第一次摇出的号码为:%dnn",first); if (first == 7 or first == 12) { printf("玩家胜nn"); money=money+cost; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)