-
[java]백준 검증수 2475번알고리즘 문제풀이/백준(자바) 2023. 6. 1. 23:35
코드
import java.util.Scanner; public class BOJ_2475 { public static void main(String[] args) { Scanner in =new Scanner(System.in); int s=0; for (int i = 0; i < 5; i++) {//고유 번호 5자리 int q =in.nextInt(); s+=Math.pow(q, 2);//5자리 2제곱 총합s } System.out.println(s%10);//s/10 나머지 출력 in.close(); } }
링크
https://www.acmicpc.net/problem/2475
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 파티가 끝나고 난 뒤 2845번 (0) 2023.06.03 [java]백준 최소, 최대 2 20053번 (0) 2023.06.02 [java]백준 카드 게임 5522번 (0) 2023.05.31 [java]백준 커트라인 25305번 (0) 2023.05.30 [java]백준 이상한 기호 15964번 (0) 2023.05.29