【例3-1】简单的猜数游戏。输入你所猜的整数(假定1~100),与计算机产生的被猜数比较,若相等,显示猜中;若不等,显示与被猜数的大小关系。
#include<stdio.h>标签:mynumber,猜数,int,yournumber,Too,printf,分支,结构 From: https://blog.51cto.com/u_15887348/5886846
int main(void)
{
int mynumber = 38;
int yournumber;
printf("Inrut you number:");
scanf("%d", &yournumber);
if(yournumber == mynumber)
printf("Good Guges!\n);
else if(younumber>myumber){ //多条语句考虑用代码块
printf("Too big!\n");
else
printf("Too small!\"_);
}
return0 0;