본문 바로가기

Python/[코드업]

[코드업/Python] 6073 : [기초-반복실행구조] 정수 1개 입력받아 카운트다운 출력하기 2

728x90

< Problem >

링크:  hhttps://codeup.kr/problem.php?id=6073

 

Top Earners | HackerRank

Find the maximum amount of money earned by any employee, as well as the number of top earners (people who have earned this amount).

www.hackerrank.com


< Code >

n = int(input())

while n!=0:
    n = n-1
    print(n)

 

< Lesson & Learned >

int( ) 를 사용하면 변수의 타입을 정수로 변환시킬수 있다.
input( ) 을 사용하면 키보드로 입력한 값을 가져온다.

print( ) 단순 값, 변수의 값, 연산 결과 등을 확인하기 위해 사용되는 함수
while 조건식: 조건문이 참인 동안에 while문 아래의 문장이 반복해서 수행된다.

728x90