Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- hashCode
- constantnumber
- reference
- 객체형변환
- 추상클래스
- methodArea
- Hashtable
- hamobee
- value
- run()
- overload
- concreteclass
- fuction
- garbagecollection
- eclipse
- Polymorphism
- abstractclass
- 콘크리트클래스
- ALTER
- arguments
- MSA
- override
- object
- super
- Eureka
- Vector
- class
- start()
- string
- 생성자
Archives
- Today
- Total
뇌운동일지
[ 수학 프로그래밍 ] 3n+1 problem 본문
def solution(i, j):
for n in range(i, j+1):
print (n, " : ", end="")
while n != 1:
if n % 2 == 0:
n = n/2
print(int(n),",", end=" ")
else:
n = (3 * n) + 1
print(int(n),",", end=" ")
print()
solution(10,19)
'python' 카테고리의 다른 글
[ 수학 프로그래밍 ] 구구단 (0) | 2020.09.25 |
---|---|
[ 수학 프로그래밍 ] n n**2 n**3 (0) | 2020.09.25 |
[ 수학 프로그래밍 ] 피보나치 수열 활용 (0) | 2020.09.25 |
python (1) | 2020.07.06 |
Comments