🧵 [문제]
2개의 수 a, b를 입력 받아, a를 b로 나눈 몫과 나머지를 출력하는 프로그램을 작성하라.
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
[input]
3
9 2
15 6
369 15
[output]
#1 4 1
#2 2 3
#3 24 9
import sys
sys.stdin = open("input.txt")
T = int(input())
for tc in range(1, T+1):
a, b = map(int,input().split())
print("#{} {} {}".format(tc, a//b, a%b ))
'# 3. APS > SWEA' 카테고리의 다른 글
SWEA # Python_D2_1945_간단한 소인수분해 (while문) (0) | 2021.02.15 |
---|---|
SWEA # Python_D1_2019_더블더블 ✅ (0) | 2021.02.15 |
SWEA # Python_D1_1938_아주 간단한 계산기 ✅ (0) | 2021.02.15 |
SWEA # Python_D1_2025_N줄덧셈 ✅ (0) | 2021.02.15 |
SWEA # Python_D1_2027_대각선 출력하기 ✅ (0) | 2021.02.15 |