알고리즘/SWAE

[백준] (단계별 - for 문) 2438, 2741, 2742, 10871, 11021, 11022, 15552 번문제..

황성안 2021. 3. 6. 23:49
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
= int(input())
for i in range(1,a+1):
    print(i)
cs
1
2
3
= 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
= 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
= 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모듈 읽어들이기
 
= int(sys.stdin.readline())
for tc in range(1,T+1):
    a,b = map(int, sys.stdin.readline().split())
    print(a+b)
cs
728x90