新手学c 遇到问题 麻烦大虾看一下求解
#include <stdio.h>#include<ctype.h>
int main(void)
{
char another_game == 'Y';
const unsigned int DELAY=1;
printf("\nTo play Simple Simon,");
printf("watch the screen for a sequence of digits.");
printf("\nWatch carefully,as the digits are only displayed for %u second%s",DELAY,DELAY>1?"s!":"!");
printf("\nThe computer will remove them,and then prompt you");
printf("to enter the same sequence.");
printf("\nWhen you do,you must put spaces between the digits.\n");
printf("\nGood luck!\nPress Enter to play\n");
scanf("%c",&another_game);
do
{
printf("\nDo you want to play again (y\n)?");
scanf("%c",&another_game);
}
while (toupper(another_game)=='Y');
return 0;
}
D:\vc\MSDev98\MyProjects\simon\simonyx.c(5) : error C2143: syntax error : missing ';' before '=='
D:\vc\MSDev98\MyProjects\simon\simonyx.c(6) : error C2143: syntax error : missing ';' before 'const'
D:\vc\MSDev98\MyProjects\simon\simonyx.c(9) : error C2065: 'DELAY' : undeclared identifier
Error executing cl.exe.
没有丢‘;’,为什么报错啊???
确实是值得思考的一个问题!{:1_1:} :sweat:这个问题很基础的。。。
char another_game == 'Y';
这句话你是要赋值吗?赋值符号是==号吗?是=吧 andalousie 发表于 2014-8-3 17:26
这个问题很基础的。。。
这句话你是要赋值吗?赋值符号是==号吗?是=吧
太谢谢啦,还真是,一直以为是缺‘;’这个呢,没注意那.......
页:
[1]