さて、私は宿題のためにやるべき研究室があり、誰かがこれを手伝ってくれるかどうか疑問に思っていました. プログラムは、変数が壊れていると言い続けます。誰かが私を助けることができれば、それは素晴らしいことです. ところで、質問は気にしないでください笑。
int main (void)
{
char answer;
printf("welcome to the celebrity look alike game. You will be asked 5 yes or no questions. To answer please either put a y for yes or an n for no");
printf("\nQuestion 1: Do you have brown eyes?");
scanf("%1s", &answer);
if (answer=='y')
{printf("\nQuestion 2:Do you have white hair?");
scanf("%1s", &answer);
if (answer=='y')
printf("\nQuestion 3:Is your height around 5 feet 10 inches?");
scanf("%1s", &answer);
if (answer=='y')
printf("\nQuestion 4:Are you a slim man?");
scanf("%1s", &answer);
if (answer=='y')
printf("\nQuestion 5: Do you dress well?");
scanf("%1s", &answer);
if (answer=='y');
printf("You really look like Matt Leblanc!");}
else printf("Sorry, you do not look like this celebrity.");
return 0;
}