본문 바로가기
Beakjoon&프로그래머스/Java

[프로그래머스/Java] [PCCE 기출문제] 2번 / 피타고라스의 정리

by 현장 2025. 2. 22.

- Code

import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int c = sc.nextInt();

        int b_square = c * c - a * a;

        System.out.println(b_square);
    }
}