下载的时候一直警告路径的问题,但是文件地址已经全是英文不带特殊字符了,甚至防火墙也关了,怎么办
不知道你这个问题是否已经解决, 如果还没有解决的话:下面是一个模拟过程:
注意!游戏开始了。。。。。。
火柴还剩下21根***
请输入你要取的火柴数目:*
3
计算机拿取的火柴数是:2
火柴还剩下16根***
请输入你要取的火柴数目:*
2
计算机拿取的火柴数是:3
火柴还剩下11根***
请输入你要取的火柴数目:*
5
请遵守游戏规则,你拿取的火柴数目有问题!请重新拿取!
火柴还剩下11根***
请输入你要取的火柴数目:*
2
计算机拿取的火柴数是:3
火柴还剩下6根***
请输入你要取的火柴数目:*
3
计算机拿取的火柴数是:2
火柴还剩下1根***
请输入你要取的火柴数目:*
1
计算机赢了!游戏结束!
#include<stdio.h>
int main() {
int computer, people, spare = 21;
printf("注意!游戏开始了。。。。。。\n");
while (1) {
printf("*******火柴还剩下%d根**********\n", spare);
printf("*******请输入你要取的火柴数目:********\n");
scanf("%d", &people);
if (people < 1 || people > 4 || people > spare) {
printf("请遵守游戏规则,你拿取的火柴数目有问题!请重新拿取!\n\n");
continue;
}
spare -= people;
if (spare == 0) {
printf("计算机赢了!游戏结束!\n");
break;
}
computer = 5 - people;
spare -= computer;
printf("计算机拿取的火柴数是:%d\n", computer);
if (spare == 0) {
printf("计算机赢了!游戏结束!\n");
break;
}
}
return 0;
}