#include<stdio.h>


void firstQuestion();

void secondQuestion();

void thirdQuestion();


int main(void)

{

int i;

for(i=0;i<3;i++){

if(i==0)

firstQuestion();

else if(i==1)

secondQuestion();

else if(i==2)

thirdQuestion();

}

if(i==3)

printf("Congratulation!  James Bond will call you soon!\nUntil then, you must study Matlab very hard.\nBye! Bye!");

}


void firstQuestion(){

int answer;

printf("Write down the first digit of the secret code = ");

scanf("%d",&answer);

while(answer!=1){

printf("The first number is often represented by the thumb of the hand\n ");

printf("Type the secret code (three decimal digits) !!");

scanf("%d",&answer);

}

}


void secondQuestion(){

int answer;

printf("Write down the second digit of the secret code = ");

scanf("%d",&answer);

while(answer!=1){

printf("The first digit is OK, but you have chosen wrong second digit. \nThe key for the second digit is twin.  Try again!!\n  ");

printf("Type the secret code (three decimal digits) !!");

scanf("%d",&answer);

}

}


void thirdQuestion(){

int answer;

printf("Write down the third digit of the secret code = ");

scanf("%d",&answer);

while(answer!=9){

printf("The first and second digits are OK, but you have chosen wrong last digit. \nThe key for the last digit is last\n ");

printf("Type the secret code (three decimal digits) !!");

scanf("%d",&answer);

}

}















이렇게 짜긴 했는데

니가 원하는게 맞는지 모르겠다.