189 8069 5689

c语言练习题-创新互联

猜数游戏
#include#include#includevoid main() {
	int Password = 0, Number = 0, price = 58, i = 0;
	system("cls");
	printf("\n====This is a number Guess Game!====\n");
	while (Password != 1234) {
		if (i >= 3) {
			return;
		}
		i++;
		puts("Please input Password: ");
		scanf("%d", &Password);
	}
	i = 0;
	while (Number != price) {
		do {
			puts("Please input a number between 1 and 100:");
			scanf("%d", &Number);
			printf("Your input Number is %d\n", Number);
		} while (!(Number >= 1 && Number<= 100));
		if (Number >= 90) {
			printf("Too Bigger ! Press any key to try again!\n");
		}
		else if (Number >= 70 && Number< 90) {
			printf("Bigger!\n");
		}
		else if (Number >= 1 && Number<= 30) {
			printf("Too Small! Press any key to try again!\n");
		}
		else if (Number >30 && Number<= 50) {
			printf("Small!Press any key to try again!\n");
		}
		else {
			if (Number == price) {
				printf("OK! You are right! Bye Bye!\n");
			}
			else if (Number< price) {
				printf("Sorry,Only a little smaller! Press any key to try again!\n");
			}
			else if (Number >price) {
				printf("Sorry, Only a little bigger!Press any key to try again!\n");
			}
		}getch();
	}

}


**```
附带密码
简单c语言,用于联系循环,和if语句

你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧

创新互联主要从事成都网站设计、成都做网站、网页设计、企业做网站、公司建网站等业务。立足成都服务宿松,十多年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:18980820575
新闻名称:c语言练习题-创新互联
文章来源:http://jkwzsj.com/article/coopid.html

其他资讯