๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Algorithm

[SW Expert Academy] - (D3)5162. ๋‘ ๊ฐ€์ง€ ๋นต์˜ ๋”œ๋ ˆ๋งˆ

by ์ฃผ๋ฐœ2 2020. 7. 1.
๋ฐ˜์‘ํ˜•

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWTaTDua3OoDFAVT&categoryId=AWTaTDua3OoDFAVT&categoryType=CODE

 

SW Expert Academy

SW ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์—ญ๋Ÿ‰ ๊ฐ•ํ™”์— ๋„์›€์ด ๋˜๋Š” ๋‹ค์–‘ํ•œ ํ•™์Šต ์ปจํ…์ธ ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!

swexpertacademy.com

์ฝ”๋“œ

import java.util.Scanner;

public class Solution {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int t = scan.nextInt();
		for(int tc=1; tc<=t; tc++) {
			int A = scan.nextInt();	// ๊ฐ€๊ฒฉ
			int B = scan.nextInt();	// ๊ฐ€๊ฒฉ
			int C = scan.nextInt(); // ํ˜„์žฌ ์ž”์•ก
			int ans = 0; // ๊ฒฐ๊ณผ ๊ฐฏ์ˆ˜
			
			int min = Math.min(A, B);
			ans = C / min;
			
			System.out.println("#" + tc + " " + ans);
			
		}
		
		scan.close();
	}

}

ํ’€์ด

๋ฌธ์ œ์—์„œ ๋นต์˜ ์ข…๋ฅ˜์— ์ƒ๊ด€์—†์ด ์ˆ˜๋Ÿ‰๋งŒ ๋งŽ์ด์‚ฌ๋ฉด ๋œ๋‹ค.

๋”ฐ๋ผ์„œ ๋‘ ๋นต์˜ ๊ฐ€๊ฒฉ์ค‘ ์ €๋ ดํ•œ ๊ฐ€๊ฒฉ์„ ์ „๋ถ€ ์‚ฌ๋ฒ„๋ฆฌ๋ฉด ๋.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€