728x90
문제 링크: https://www.acmicpc.net/problem/4696
4696번: St. Ives
Input consists of multiple data sets. Each data set consists of a line with a single floating point number number representing the numbers of wives, sacks per wife, cats per sack, and kittens per cat that Robert encountered that year. End of input is indic
www.acmicpc.net
문제 풀이
사칙연산
코드
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
input = sys.stdin.readline | |
while True: | |
n = float(input()) | |
if n == 0: break | |
print('%.2f' %(1+n+n**2+n**3+n**4)) |
728x90
'BOJ' 카테고리의 다른 글
[BOJ][Python] 백준 16973번 - 직사각형 탈출 (0) | 2022.08.05 |
---|---|
[BOJ][Python] 백준 4658번 - 삼각형 게임 (0) | 2022.08.03 |
[BOJ][Python] 백준 11434번 - Ampelmännchen (0) | 2022.08.02 |
[BOJ][Python] 백준 2344번 - 거울 (0) | 2022.08.02 |
[BOJ][Python] 백준 20412번 - 추첨상 사수 대작전! (Hard) (0) | 2022.07.02 |