나는 이것을 잘못 생각하고있다. 컴파일 할 때마다 네 번째 사용자 입력에서 멈추고 "반환 된 프로세스"항목을 보여줍니다. 내가 뭘 잘못 했니? (C)
#include <stdio.h>
#include <conio.h>
int main() {
char firstname[15], class, swordch0c1, swordch0c2;
int health, healthtot, armor, armortot;
printf("Hello there! Could I have your first name?\n>");
scanf("%s", firstname);
printf("\n---------------------The Legend of %s---------------------", firstname);
printf("\nPress Enter to continue.");
getch();
printf("\n\n\nYou are %s, a(n): \nA.Swordsman\nB.Assassin\nC.Archer\nD.Mage\n>", firstname);
scanf(" %c", &class);
/*swordsman story starts here*/
if (class=='a' || class=='A')
{
printf("\n\nThere you stand, at your boring everyday post.\nWhen you joined the army, you thought it would be more exciting than this.\nJust then, you see your general walking towards you.");
printf("\n\nYou quickly improve your posture. \"Soldier, I have an opportunity for you\"\nA.\"Really? What is it?\"\nB.\"I'm not interested\"\n>");
scanf(" %c", &swordch0c1);
if (swordch0c1=='b'||swordch0c1=='B')
{
printf("\n\"But... I didn't even tell you what it was. Okay, suit yourself\" You are DOOMED to a life of boredom.\n\n\n\n\n");
}
if (swordch0c1=='a'||swordch0c1=='A')
{
printf("\n\n\n\"Well, you see, there's this dragon. He's been causing big problems.\nHe's destroyed villages, harrassed the priests on the mountain,\n");
... 편집 : 그것은 나를 네 번째 입력에 넣어 수 없습니다. enter를 치면, 반환 된 프로세스가 표시됩니다. 당신은 그러나 실제로는 두 개의 문자를 입력하기 위해 당신이 문자를 입력, 단일 문자를 읽도록 요구하고있다
scanf(" %c", &swordch0c1);
: 는를 입력
네 번째 입력을 입력 하시겠습니까? 아니면 그냥 건너 뛰시겠습니까? –
전체 코드를 표시해야합니다 (또는 적어도 "네 번째 사용자 입력"시점까지). – jwodder
@jwodder, 그것은 네 번째 입력까지 코드입니다. – Jeremy