1 2 3 4 5 6 7 8 9 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 2.15 »ç¿ëÀڷκÎÅÍ Á¤¼ö ÀԷ¹ޱâ, 62ÂÊ # # ½ÅÀå°ú üÁßÀº ½Ç¼öÇüÅÂÀÎ ¹®ÀÚ¿·Î ÀÔ·Â ¹Þ¾Ò±â¶§¹®¿¡ float()¸¦ »ç¿ëÇÏ¿© ½Ç¼ö ÀÚ·áÇüÀ¸·Î º¯È¯ÇÑ´Ù. height = float(input("½ÅÀ带 ÀÔ·ÂÇϽÿÀ: ")) weight = float(input("üÁ߸¦ ÀÔ·ÂÇϽÿÀ: ")) bmi = weight / height**2 print(bmi) | cs |
1 2 3 4 5 6 7 8 9 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 2.15 »ç¿ëÀڷκÎÅÍ Á¤¼ö ÀԷ¹ޱâ, 62ÂÊ # x = int(input("ù ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: ")) y = int(input("µÎ ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: ")) sum = x + y average = sum / 2 print(x, "°ú", y, "ÀÇ ÇÕÀº", sum, ", Æò±ÕÀº", average, "ÀÔ´Ï´Ù.") | cs |
1 2 3 4 5 6 7 8 9 10 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # 2.15 »ç¿ëÀڷκÎÅÍ Á¤¼ö ÀԷ¹ޱâ, 62ÂÊ # x = int(input("ù ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: ")) y = int(input("µÎ ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: ")) z = int(input("¼¼ ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: ")) sum = x + y + z average = sum / 3 print(x, "°ú", y, "°ú", z, "ÀÇ ÇÕÀº", sum, ", Æò±ÕÀº", average, "ÀÔ´Ï´Ù.") | cs |