PythonHolic
[python] 민수의 마법 항아리 문제 본문
여기서 체크 표시는 "α" 입니다
aim = int(input("목표로 하는 금액 >>> "))
total = 0
day = 0
while True:
count=0
alpha = 0
if total < aim:
if day==0:
m = int(input("넣을 돈 >>> "))
for i in range(1,m+1):
if m % i==0:
count+=1
if count>=50:
alpha = m
elif count<50 and count>=30:
alpha = 10000
elif count<30:
alpha = 100
total = 2*m+alpha
elif day>0:
for i in range(1,total+1):
if total % i==0:
count+=1
if count>=50:
alpha = total
elif count<50 and count>=30:
alpha = 10000
elif count<30:
alpha = 100
total = 2*total+alpha
day+=1
if total > aim:
print("최종금액 {}원".format(total))
print("걸리는 시간 {}일".format(day))
break
'파이썬 과제 도와주기 일지' 카테고리의 다른 글
[python] 재귀를 이용하여 리스트를 분할하기 (0) | 2020.06.25 |
---|---|
[python] 어버이날 선물 목표 금액 채우기 (0) | 2020.06.25 |
[python] 8명 학생에 대한 성적 관리 프로그램 (0) | 2020.06.25 |
[python] 대수학자 minje-Kim이 만든 minjeK수열 문제 (0) | 2020.06.25 |
[python] 리스트 안에 있는 단어중 가장 긴 단어와 짧은 단어 찾기 (1) | 2020.06.25 |
Comments