学习过程中,又遇新题,请各位指点迷津!!!
#include <stdio.h>int main(void)
{
int chosen = 0;
int guess = 0;
int count = 0;
chosen = 20;
count = 5;
printf("\nThis is a guessing game");
printf("\nI have a number between 1 and 25"
" which you must guess.");
for(;count>0;--count)
{
printf("\nYou have %d tr%s left",count,count==1?'y':'ies');
printf("\nEnter a guess: ");
scanf("%d",&guess);
if(guess==chosen)
{
printf("\nYou guessed it!");
return 0;
}
if(guess<1 || guess>25)
printf("\nI said between 1 and 25.");
else
printf("\nSorry,%d is wrong.",guess);
}
printf("\nYou have had three tries and failed.The number was %d.",chosen);
getchar();
getchar();
return 0;
}
执行后提示"0x77c12a16"指令引用的"0x00696573"内存。该内存不能为"read"。
要终止程序,请单击“确定”。
要调试程序,请单击“取消”。
怎么才能正常运行,请各位指点。