数十载人世游
2017-07-30 01:18
采纳率: 50%
浏览 2.7k
已采纳

C语言error C2065: 'Y' : undeclared identifier怎么破?

include

int main(void)
{
int amount,a;
printf("Do you have any dog?Please input 'Y'or'N'\n");
scanf("%c",&a);

if(a == Y)
{

     printf("Please input the amount of the dogs you have.\n");
     scanf("%d",&amount);
     printf("You have %d dog(s).\n",amount);

}
else if(a == N)
{
     printf("Oh,it's a pity.\n");
}

return 0;

1条回答 默认 最新

相关推荐 更多相似问题