#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);
}
}
이렇게 짜긴 했는데
니가 원하는게 맞는지 모르겠다.
벼릐내릐능하느리노무아름다오바버처럼나능그져눙무를흐리며서인내
니가 폴리모피즘 이딴건 전혀 안배웠을거 같아서 그냥 저렇게 짜봤다.
이게 매트랩이라고...?
ㄴ매틀랩게이냐? 매틀랩아니고 c언언데 매틀랩게이가 c언어고수 찾길래 c언어로도 되는줄 알고 c언어로 짰는데
매틀랩도 c언어랑 거의 비슷하니까 문법만 조금다르니까 저런식으로 짜면 될거다. 내가 매틀랩 안쓴지 오래되서 문법은 까먹음
씨언어가 메인이긴 한데 조금 달라서 당연히 저리 짜면 안됨.
근데 c언어 하는애 찾길래 c언어로 짠겨 그리고 메틀랩으로 저거에서 진짜 글자 몇개만 바꾸면 되지않냐
그냥 저 코드를 매트랩에 맞게만 바꾸면 될 듯
매트랩 문법 존나 쉬워. 그냥 책 대충 보면서 하면 돼. 아니면 인터넷 뒤져서 매트랩으로 짠 프로그램 구한 다음에 대충 훑어보면 저정도 짜는건 문제 없을거다.