これはこれまでの私のコードです。目的の c を使用しています。小さいですが、デフォルトの回答を作成したいと思います。たとえば、誰かが「パイが好き」と入力すると、「わかりません」と表示されます。
printf("This is a text game! You will be shown what is going on");
printf("\nand it is up to you to decide what to do.");
printf("\n\nThere is a gem on the ground.");
printf("\nWhat do you want to do");
printf("\n>");
char string[256];
fgets(string, 255, stdin);
if (strcmp(string, "pick up gem\n") == 0)
{
printf("Got Gem");
}
else if (strcmp(string, "kick gem\n") == 0){
printf("Gem flew off the road.");
}