求解,不知道问题出在什么地方;输出一直是****wrong****too lager
#include "stdio.h"#include "stdlib.h"
main()
{
int magic,guess,counter;
magic=rand();
guess=magic-1;
counter=0;
while(magic!=guess)
{
printf("please input guess:");
scanf("%d",guess);
counter++;
if(guess>magic)
printf("****wrong****too lager\n");
else if (guess<magic)
printf("****wrong****too low\n");
}
printf("***right****\n");
printf("%d",counter);
}