猜数游戏怎么老是high
#include<stdlib.h>#include<stdio.h>
void main()
{
int magic;
int guess;
int counter;
guess=magic-1;
counter=0;
while(magic!=guess)
{
printf("guess the magic number:");
scanf("%d",&guess);
counter++;
if(guess>magic)
printf("wrong to high\n");
else if(guess<magic)
printf("wrong to low\n");
}
printf("right\n");
printf("guess is %d\n",counter);
}