happy coding
[java] 2475. 검증수 본문
import java.io.*;
import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//첫째 줄에 결과를 계산할 정수 5개 입력 받기
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int c = Integer.parseInt(st.nextToken());
int d = Integer.parseInt(st.nextToken());
int e = Integer.parseInt(st.nextToken());
//검증수 출력
int output = (int) ((Math.pow(a,2)+Math.pow(b,2)+Math.pow(c,2)+Math.pow(d,2)+Math.pow(e,2))%10);
System.out.println(output);
}
}
하 기분이 넘 좋다.. 새싹 끝!
'coding study > baekjoon' 카테고리의 다른 글
[java] 11659. 구간 합 구하기 4 (0) | 2023.07.24 |
---|---|
[java] 10809. 알파벳 찾기 (0) | 2023.07.24 |
[java] 15964. 이상한 기호 (0) | 2023.07.24 |
[java] 9086. 문자열 (0) | 2023.07.24 |
[java] 11718. 그대로 출력하기 (0) | 2023.07.24 |
Comments