프로그래머스 코딩 테스트 10. 피타고라스의 정리
1. 문제 설명 - 디버깅

제한 사항

2. 입출력 예시


3. 코드 수정
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);
}
}
- 빗변의 제곱 - 한 변의 제곱 = 나머지 변의 제곱
- b_square = c*c - a*a;
4. 테스트 실행

5. 제출 후 채점

Share article