OK then see this:
Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(void)
{
char guess[15];
int score;
clrscr();
printf("\"LET'S START\"\nPlease turn on your Caps Lock.\n\n");
{
score=0;
printf("(1) Which country is called \"The Land of The Risisng Sun\" ?\n");
gets(guess);
guess[14]=(strcmp(guess,"JAPAN") == 0) ? 0:1;
switch ( guess[14] )
{
case 0:
printf("That's corrrrrrect\n");
printf("Your score is %d.",score+4);
break;
case 1:
printf("Wrong Answer\nTry again\n");
gets(guess);
if (strcmp(guess,"JAPAN")==0)
{
printf("Correct\nYour score is %d.",score+2);
break;
}
else
printf("Wrong again\nTry once more\n");
gets(guess);
strcmp(guess,"JAPAN");
if(strcmp(guess,"JAPAN")==0)
{
printf("\nright this time\nscore=%d",score+1);
break;
}
default:
printf("SORRY You LOST!\nThe answer is \"JAPAN\".");
printf("Your score is %d.",score);
break;
}
printf("\n\n(2) In Which country does Mount Fuji locates?\n");
gets(guess);
guess[13]=(strcmp(guess,"JAPAN") == 0) ? 0:1;
switch( guess[13] )
{
case 0:
printf("\nCorrrrrect!\nscore=%d",score+4);
break;
case 1:
printf("You're wrong\nTry again\n");
gets(guess);
if(strcmp(guess,"JAPAN") == 0)
{
printf("That's Right!\nscore=%d",score+2);
break;
}
else
printf("Wrong again.\nTry again");
gets(guess);
if(strcmp(guess,"JAPAN")==0)
{
printf("Right this time.\nscore=%d",score+1);
break;
}
default:
printf("SORRY you lost!\n\"JAPAN\" is the answer.\n");
printf("score=%d",score);
break;
}
}
getch();
}