|Developer_Study/Python
백준 _ for문
케리's
2021. 5. 20. 20:58
✔ 2739 (구구단)
👍 나의 코드 결과
n = int(input())
for i in range(1,10):
print (n,"*",i,"=", n*i)
✔ 10950 (A+B-3)
👍 나의 코드 결과
t = int(input())
for i in range(t):
a,b = map(int, input().split())
print(a+b)
✔ 8393 (합)
👍 나의 코드 결과
n = int(input())
hap = 0 # 입력받은 값이 더할 수 있도록 0으로 초기화
for i in range(n+1): #
hap = hap + i
print(hap)
✔ 2741 (N 찍기)
👍 나의 코드 결과
n = int(input())
for i in range(1,n+1):
print(i)
✔ 2742 (N 기찍)
👍 나의 코드 결과
n = int(input())
for i in range(n,0,-1): # n부터 1까지 -1씩 증가하며(즉 1씩 내려가며 숫자 출력)
print(i)
✔ 11021 (A+B-7)
👍 나의 코드 결과
t = int(input()) # 첫 줄에 테스트 케이스 갯수 t가 주어진다.
for x in range(1,t+1):
a,b = map(int,input().split())
print("Case #%d: %d"%(x,a+b))
✔ 11022 (A+B -8)
👍 나의 코드 결과
t = int(input())
for i in range(1, t+1):
a,b = map(int,input().split())
print("Case #%d: %d + %d = %d"%(i, a, b, a+b))
✔ 2438 (별 찍기 -1)
👍 나의 코드 결과
a = int(input())
for i in range (1,a+1):
print("*"*i)
✔ 2439 (별 찍기 -2)
👍 나의 코드 결과
a = int(input())
for i in range (1,a+1):
print(" "*(a-i) + "*"*i)