umilove98의 블로그

백준 6749 Java 본문

algorithm/백준

백준 6749 Java

umilove98 2021. 7. 17. 19:58
반응형

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q6749 {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int third = Integer.parseInt(bf.readLine()); //셋째 나이
		int second = Integer.parseInt(bf.readLine()); //둘째 나이
		int rule = second - third; //서로의 나이 차 규칙을 찾음
		int first = second + rule;
		System.out.println(first); //첫째 나이 출력

	}

}
반응형

'algorithm > 백준' 카테고리의 다른 글

백준 8437 Java  (0) 2021.07.17
백준 8370 Java  (0) 2021.07.17
백준 5554 Java  (0) 2021.07.17
백준 5522 Java  (0) 2021.07.17
백준 3046 Java  (0) 2021.07.17