C语言字符串问题
#include<stdio.h>#include<string.h>#defineANSWER"Grant"#defineMAX40intmain(){chara[MA...
#include<stdio.h>
#include<string.h>
#define ANSWER "Grant"
#define MAX 40
int main ()
{
char a[MAX];
puts ("who is buried in Grant's tomb");
gets(a);
while (strcmp(a,ANSWER)!=0) 这里不等于0什么意思?
{
puts("No,that's wrong.Try again.");
gets(a);
}
puts("That's right!");
return 0;
} 展开
#include<string.h>
#define ANSWER "Grant"
#define MAX 40
int main ()
{
char a[MAX];
puts ("who is buried in Grant's tomb");
gets(a);
while (strcmp(a,ANSWER)!=0) 这里不等于0什么意思?
{
puts("No,that's wrong.Try again.");
gets(a);
}
puts("That's right!");
return 0;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询