Á¤¼ºÈÆ
    µµÀü¹®Á¦ 1) (¸ð¹ü ´ä¾È)



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
 
int main(void)
{
    int money, price, change;
 
    printf("ÅõÀÔÇÑ µ·: ");
    scanf("%d"&money);
 
    printf("¹°°Ç°ª: ");
    scanf("%d"&price);
 
    change = money - price;
    printf("°Å½º¸§µ·:  %d\n\n", change);
 
 
    int coin100s = change / 100;    // °Å½º¸§µ·¿¡¼­ 100¿ø Â¥¸®ÀÇ °³¼ö °è»ê
    change = change % 100;        // °Å½º¸§µ·¿¡¼­ 100¿ø Â¥¸®¸¦ ³»ÁÖ°í ³²Àº µ·
 
    int coin50s = change / 50;
    change = change % 50;
 
    int coin10s = change / 10;        // °Å½º¸§µ·¿¡¼­ 10¿ø Â¥¸®ÀÇ °³¼ö °è»ê
    change = change % 10;        // °Å½º¸§µ·¿¡¼­ 10¿ø Â¥¸®¸¦ ³»ÁÖ°í ³²Àº µ·
 
    printf("100¿ø µ¿ÀüÀÇ °³¼ö: %d\n", coin100s);
    printf("50¿ø µ¿ÀüÀÇ °³¼ö: %d\n", coin50s);
    printf("10¿ø µ¿ÀüÀÇ °³¼ö: %d\n", coin10s);
 
    return 0;
}
 
cs

  µî·ÏÀÏ : 2022-03-14 [15:33] Á¶È¸ : 1574 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûcondition.c (±³Àç)
¡ä ´ÙÀ½±Ûif_else2.c (±³Àç)
ÇÁ·Î±×·¡¹Ö¾ð¾î ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
Mini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) Ãß°¡ ±¸Çö // ¡Ú¡Ú¡Ú ±â¸»°úÁ¦ °ÔÀÓ±¸Çö ½Ã Âü°í
½Ç½À ¸ñÂ÷
81 ¦¦❶ lleap_year.c (±³Àç) 1926 02-22
80 ¦¦❶ lcoin.c (±³Àç) 1873 02-22
79 ¦¦❶ lcheck_number.c (±³Àç) 1790 02-22
78 ¦¦❶ lcondition.c (±³Àç) 1791 02-22
77 ¦¦❶ lif_else3.c (±³Àç) 1928 02-21
76 ¦¦❶ lif_else2.c (±³Àç) 1983 02-21
75 ¦¦❶ lif_else1.c (±³Àç) 1875 02-21
74 (4Àå) ¼ö½Ä°ú ¿¬»êÀÚ 1195 02-21
73 ¦¦❶ Mini Project (º¹¸® °è»ê) 1380 03-14
72    ¦¦❷ Mini Project (º¹¸® °è»ê) (¸ð¹ü ´ä¾È) 1659 03-14
71 ¦¦❶ ¨ÕÃß°¡ µµÀü ¹®Á¦ (BMI °è»ê±â) 337 04-04
70    ¦¦❷ Ãß°¡ µµÀü ¹®Á¦ (BMI °è»ê±â) (¸ð¹ü ´ä¾È) 397 04-04
69 ¦¦❶ µµÀü¹®Á¦ 2) 1392 03-14
68    ¦¦❷ µµÀü¹®Á¦ 2) (¸ð¹ü ´ä¾È) 1624 03-14
67 ¦¦❶ µµÀü¹®Á¦ 1) 1188 03-14
66    ¦¦❷ µµÀü¹®Á¦ 1) (¸ð¹ü ´ä¾È) 1574 03-14
65 ¦¦❶ lcal_quad_eq.c (±³Àç) 1954 02-21
64 ¦¦❶ ltypecast.c (±³Àç) 1876 02-21
63 ¦¦❶ lprec.c (±³Àç) 2028 02-21
62 ¦¦❶ lbit_operator.c (±³Àç) 2028 02-21

[1] [Prev]-[11][12][13][14][15]