Dev.baelanche

[백준 11772] POT 본문

Data Structure & Algorithm/PS - JAVA

[백준 11772] POT

baelanche 2019. 6. 8. 15:54
반응형

 

 

번역

 

 

 

정말 발번역이다.

 

 

문제가 너무 쉬워서 힌트만 보고도 풀 수 있다. 직접 번역은 처음이라 재미있었다.

 

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        
        int sum = 0;
        for(int i=0; i<n; i++) {
            int idx = sc.nextInt();
            int sub = idx/10;
            int sup = idx%10;
            sum += (int)Math.pow(sub, sup);
        }
        System.out.println(sum);
    }
}
반응형

'Data Structure & Algorithm > PS - JAVA' 카테고리의 다른 글

[백준 10551] STROJOPIS  (0) 2019.06.10
[백준 3486] Adding Reversed Number  (0) 2019.06.10
[백준 10451] 순열 사이클  (0) 2019.06.08
[백준 1890] 점프  (0) 2019.06.08
[백준 7569] 토마토  (0) 2019.06.08
Comments