简单猜数游戏3

/*简单猜数游戏,magic number#3*/
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
int magic; /*magic number*/
int guess; /*user's guess*/
printf("\nWelcome to the magic number game\n");
magic=rand(); /*产生随机数*/
printf("\nGuess the magic number:");
scanf("%d,&guess");
if(guess==magic)
{
printf("***Right***\n");
printf("%d is the magic number\n",magic);
}
else if(guess>magic)
printf("Wrong,too high\n");
else
printf("Wrong,too low\n");
system("PAUSE");
return 0;

} /*end main*/

posted @ 2017-03-08 20:15  HGR  阅读(212)  评论(0编辑  收藏  举报