1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { int sum; // ÃѾ×À» ÀúÀåÇÏ´Â º¯¼ö int price; // °¢ Ç׸ñÀÇ °¡°ÝÀ» ÀúÀåÇÏ´Â º¯¼ö int nights; // ¸î ¹ÚÀÎÁö¸¦ ÀúÀåÇÏ´Â º¯¼ö sum = 0; // 0À¸·Î ÃʱâÈÇÑ´Ù. printf("¿©ÇàÀº ¸î¹ÚÀΰ¡¿ä?: "); scanf("%d", &nights); printf("Ç×°ø±Ç °¡°Ý: "); scanf("%d", &price); sum = sum + price; printf("È£ÅÚ 1¹Ú °¡°Ý: "); scanf("%d", &price); sum = sum + nights * price; printf("ÇÏ·ç¿¡ ÇÊ¿äÇÑ ¿ëµ·: "); scanf("%d", &price); sum = sum + nights * price; printf("===============================\n"); printf("ÃÑ ¿©Çà ºñ¿ë: %d \n", sum); printf("===============================\n"); return 0; } | cs |