int main(void)
{
int answer = 48;
int low = 1, high = 100;
int guess = 0;
while(guess!=answer)
{
printf("請在%d到%d中猜一個數字:", low, high);
scanf("%d", &guess);
if(guess>answer)
{
guess = high;
}
else
{
guess = low;
}
}
}
假如我輸入的guess比answer大了話 我想將guess定義成High 反之則是low
再麻煩大大解題了
C_can
相关分类