c語言猜數字遊戯代碼
#includestdio.h
#include stdlib.h
#include math.h
#include time.h
int main()
{
int i,j,c,g=1;
while(g)
{
srand((unsigned)time(NULL));
i=rand()0;
c=0;
for(;;)
{
printf("Please input the data請輸入數據:");
scanf("%d",
c ;
if(j i)
printf("Too high太大了!\n");
else if(j i)
printf("Too low太小了!\n");
else
{
printf("Right正確!\n");
printf("The c is:%d\n",c);
printf("Wanna continue想繼續嗎? 1.continue繼續 0.exit退出\n");
scanf("%d",
break;
}
}
}
}
本站是提供個人知識琯理的網絡存儲空間,所有內容均由用戶發佈,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發現有害或侵權內容,請點擊一鍵擧報。
0條評論