SWEA

[SWEA] 몫과 나머지 출력하기

itsnot4me 2024. 9. 19. 18:05
import java.util.Scanner;
import java.io.FileInputStream;

class Solution
{
	public static void main(String args[]) throws Exception
	{
		Scanner sc = new Scanner(System.in);
		int T;
		T=sc.nextInt();
		for(int test_case = 1; test_case <= T; test_case++)
		{
			int a = sc.nextInt();
            int b = sc.nextInt();
            System.out.println("#" + test_case + " " + a/b + " " + a%b);
		}
	}
}

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=1&contestProbId=AV5QGNvKAtEDFAUq&categoryId=AV5QGNvKAtEDFAUq&categoryType=CODE&problemTitle=&orderBy=FIRST_REG_DATETIME&selectCodeLang=ALL&select-1=1&pageSize=10&pageIndex=2

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

'SWEA' 카테고리의 다른 글

[SWEA] N줄 덧셈  (0) 2024.09.19
[SWEA] 대각선 출력하기  (0) 2024.09.19
[SWEA] 서랍의 비밀번호  (1) 2024.09.16
[SWEA] 스탬프 찍기  (1) 2024.09.13
[SWEA] 신문 헤드라인  (0) 2024.09.13