공부/SWEA
[SWEA-3431] 준환이의 운동관리 - Java
빈v
2024. 3. 9. 22:33
728x90
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWE_ZXcqAAMDFAV2
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
SWEA 3431번 준환이의 운동관리 자바 풀이
난이도: D3
코드
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();
int c=sc.nextInt();
if(a>c){
System.out.println("#"+test_case+" "+(a-c));
}else if(b<c){
System.out.println("#"+test_case+" -1");
}else{
System.out.println("#"+test_case+" 0");
}
}
}
}
728x90
반응형