728x90
반응형
1
2
3
4
5
6
7
|
n = int(input())
for i in range(1,n+1):
for j in range(n-i):
print(" ",end="")
for j in range(i):
print("*",end="")
print()
|
cs |
1
2
3
|
a = int(input())
for i in range(1,a+1):
print(i)
|
cs |
1
2
3
|
a = int(input())
for i in range(1,a+1)[::-1]:
print(i)
|
cs |
1
2
3
4
5
|
N, X = map(int, input().split())
arr = list(map(int,input().split()))
for i in range(N):
if arr[i] < X:
print(arr[i],end=" ")
|
cs |
1
2
3
4
|
T = int(input())
for tc in range(1, T+1):
a, b = map(int,input().split())
print("Case #{}: {}".format(tc,a+b))
|
cs |
1
2
3
4
|
T = int(input())
for tc in range(1, T+1):
a, b = map(int,input().split())
print("Case #{}: {} + {} = {}".format(tc,a,b,a+b))
|
cs |
1
2
3
4
5
6
|
import sys # sys모듈 읽어들이기
T = int(sys.stdin.readline())
for tc in range(1,T+1):
a,b = map(int, sys.stdin.readline().split())
print(a+b)
|
cs |
728x90
반응형
'알고리즘 > SWAE' 카테고리의 다른 글
5174. subtree, 5176 이진탐색, 5177. 이진 힙, 5178. 노드의 합 (0) | 2021.04.06 |
---|---|
[SWAE] 1231.중위순회 (0) | 2021.04.05 |
[Python] 5097. 회전, 5099. 피자 굽기, 5102. 노드의 거리, 5105 미로의 거리 (0) | 2021.03.05 |
[Python] [D3] 1225. 암호생성기 ( 큐 ) (0) | 2021.03.04 |
[Python] (D2) 4871.그래프 경로 // DFS 응용 문제 (0) | 2021.03.02 |