선릉역 1번 출구
baekjoon - if문 본문
1. 1330
a, b = map(int, input().split()) if a > b: print('>') elif a < b: print('<') else: print('==') |
2. 9498
a = int(input()) if a >= 90: print('A') elif a >= 80: print('B') elif a >= 70: print('C') elif a >= 60: print('D') else: print('F') |
3. 2753
a = int(input()) if (a % 4 == 0) & (a % 100 != 0): print(1) elif a % 400 == 0: print(1) else: print(0) |
#괄호 표시 잘하자
4. 14681
a = int(input()) b = int(input()) if (a > 0) & (b > 0): print(1) elif (a > 0) & (b < 0) : print(4) elif (a < 0) & (b > 0): print(2) else: print(3) |
5. 2884
H, M = map(int, input().split()) if M >= 45: print(H,M-45) else: if H == 0: print(23,M+15) else: print(H-1, M+15) |
'Algorithm > Algorithm 문제풀이' 카테고리의 다른 글
baekjoon - 함수 (0) | 2021.08.17 |
---|---|
baekjoon - 1차원 배열 (0) | 2021.08.17 |
baekjoon - while문 (0) | 2021.08.16 |
baekjoon - for문 (0) | 2021.08.16 |
baekjoon - 입출력과 사칙연산 (0) | 2021.08.16 |
Comments