11월 06일
1. struct 응용한 문제풀이 #include #include #include struct Problem //사전정의하는 칸 { char Question[100]; char Case[3][50]; int Answer; int Used; }; struct Problem Problems [] = //문제칸 { {"우유가 아닌 것을 고르시오","딸기우유","초코우유","아메리카노",3,0}, {"학원에 나오지 않는 날을 고르시오","월요일","토요일","화요일",2.0}, {"내가 좋아하는 아이스크림을 고르시오", "바닐라", "녹차", "딸기",1,0} }; int main() { char answer; int Problems_index[3] = {0,1,2}; for (int i=0; iAnswer =..
10월 24일
1. #DEFINE 응용 - HAP(CAKE) Q : x+y, x*y 로 각각 정의하고, h1, h2 를 10과 곱하여 출력하라 x = 3, y = 4 A : #include #define CAKE1(x,y) x+y #define CAKE2(x,y) (x+y) int main () { int h1 = 0, h2 = 0 ; h1 = 10 * CAKE1(3,4) ; h2 = 10 * CAKE2(3,4) ; printf("h1 = %d , h2 = %d ", h1, h2); return 0; } h1 = 34, h2 = 70 ============================================== 2. define, output, count 응용 Q : output() 을 x로 정의하고, count..