# 2์ฅ Lab, Mini Project ๋ฌธ์ ํ์ด
72p_Lab)
#include <stdio.h>
int main()
{
int first = 0;
int second = 0;
printf("์ฒซ ๋ฒ์งธ ์ซ์๋ฅผ ์
๋ ฅํ์์ค: ");
scanf_s("%d", &first);
printf("๋ ๋ฒ์งธ ์ซ์๋ฅผ ์
๋ ฅํ์์ค: ");
scanf_s("%d", &second);
int sum = first + second;
int min = first - second;
int mul = first * second;
int div = first / second;
printf("๋ ์์ ํฉ: %d \n", sum);
printf("๋ ์์ ์ฐจ: %d \n", min);
printf("๋ ์์ ๊ณฑ: %d \n", mul);
printf("๋ ์์ ๋ชซ: %d", div);
return 0;
}
74p_Mini Project)
#include <stdio.h>
int main()
{
int how_many_days = 0;
int flight_cost = 0;
int hotel_cost = 0;
int one_day_money = 0;
printf("์ฌํ์ ๋ช๋ฐ์ธ๊ฐ์?: ");
scanf_s("%d", &how_many_days);
printf("ํญ๊ณต๊ถ ๊ฐ๊ฒฉ: ");
scanf_s("%d", &flight_cost);
printf("ํธํ
1๋ฐ ๊ฐ๊ฒฉ: ");
scanf_s("%d", &hotel_cost);
printf("ํ๋ฃจ์ ํ์ํ ์ฉ๋: ");
scanf_s("%d", &one_day_money);
int total = how_many_days * hotel_cost + one_day_money * (how_many_days + 1) + flight_cost;
printf("=============================\n");
printf("์ด ์ฌํ ๋น์ฉ: %d \n", total);
printf("=============================");
return 0;
}