Jun's Development Journey
[SWEA] 1217. [S/W 문제해결 기본] Stack1 - 거듭 제곱 본문
문제
https://www.swexpertacademy.com/main/learn/course/lectureProblemViewer.do
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
www.swexpertacademy.com
풀이
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
public class Solution {
static Scanner scan = new Scanner(System.in);
static int get_power(int N, int M) {
if(M==1)
return N;
return N*get_power(N,M-1);
}
static void solution() {
int N,M;
for(int i=1;i<=10;i++) {
scan.nextInt();
N = scan.nextInt();
M = scan.nextInt();
System.out.println("#"+i+" "+get_power(N,M));
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
solution();
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
'SWEA > Intermediate' 카테고리의 다른 글
[SWEA] 1219. [S/W 문제해결 기본] Stack1 - 길찾기 (0) | 2019.08.05 |
---|---|
[SWEA] 1218. [S/W 문제해결 기본] Stack1 - 괄호 짝짓기 (0) | 2019.08.04 |
[SWEA] 1216. [S/W 문제해결 기본] String - 회문2 (0) | 2019.08.02 |
[SWEA] 1215. [S/W 문제해결 기본] String - 회문1 (0) | 2019.08.02 |
[SWEA] 1213. [S/W 문제해결 기본] String - String (0) | 2019.08.02 |