c的一个小问题,请高手帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/24 13:53:53
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
void main()
{
int count,number,guess;
char yes='Y';
printf("\nNow let us play the game.\nGuess the number:");
while(toupper(yes)=='Y')
{
count=0;
randomize(); /*'randomize' : undeclared identifier*/
number=random(100)+1;/*'random' : undeclared identifier*/
do
{
do
{
printf("\n Input an integer number(1-100):");
scanf("%d",&guess);
}while(!(guess>=1&&guess<=100));
if(guess<number)
printf("\n Your answer is LOW ,try again.");
if(guess>number)
printf("\n Your answer is HIGH ,try again.");
count++;
if(count==15)
{
printf("\n This is the %dtimes!Think it hard next!");
exit(0);
}

#包括 #包括 #包括无效的Main ( ) (诠释计数,数量,猜测;烧焦是= ' Y键; printf ( “ \ nnow让我们玩游戏。 \ nguess的数目: ” ) ;而( toupper (是) == ' Y键) (计数= 0 ;随机( ) ; / * '随机' :未经宣布的标识符* /人数=随机( 100 )一; / * '随机' :未经宣布的标识符* /做(做( printf ( “ \ n输入一个整数号码( 1-100 ):"); scanf ( “ % D ”类,及猜) ; )而( ! (猜> = 1 & &猜测< = 100 ) ) ;如果(猜想