[백준/Java] 2475 : 검증수

SEOP·2024년 6월 7일
0
post-custom-banner

import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new BufferedReader(new InputStreamReader(System.in)));
        BufferedWriter bw = new BufferedWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        String[] strArr = br.readLine().split(" ");

        int firstOfArray  = (int) Math.pow(Integer.parseInt(strArr[0]),2);
        int secondOfArray = (int) Math.pow(Integer.parseInt(strArr[1]),2);
        int thirdOfArray  = (int) Math.pow(Integer.parseInt(strArr[2]),2);
        int fourthOfArray = (int) Math.pow(Integer.parseInt(strArr[3]),2);
        int fifthOfArray  = (int) Math.pow(Integer.parseInt(strArr[4]),2);

        String result = String.valueOf( (firstOfArray + secondOfArray + thirdOfArray + fourthOfArray + fifthOfArray) % 10);

        bw.write(result);
        bw.flush();
        bw.close();
    }
}
profile
응애 나 애기 개발자
post-custom-banner

0개의 댓글