첫째 줄 : 테스트 케이스 번호
둘째 줄 : 숫자 N, M 두 개
#부호 + 테스트 케이스 번호 + " " + 거듭제곱 결과 출력
import java.util.Scanner;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
/*int T;
T=sc.nextInt();*/
for(int test_case = 1; test_case <= 10; test_case++)
{
int N = sc.nextInt();
int num = sc.nextInt();
int x = sc.nextInt();
for(int i=1; i<x; i++) {
num=num*num;
}
System.out.println("#" + N + " " + num);
}
}
}
import java.util.Scanner;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
/*int T;
T=sc.nextInt();*/
for(int test_case = 1; test_case <= 10; test_case++)
{
int N = sc.nextInt();
int num = sc.nextInt();
int result = 1;
int x = sc.nextInt();
for(int i=0; i<x; i++) {
result *= num;
}
System.out.println("#" + N + " " + result);
}
}
}

import java.util.Scanner;
class Solution
{
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
/*int T;
T=sc.nextInt();*/
for(int test_case = 1; test_case <= 10; test_case++)
{
int N = sc.nextInt();
int num = sc.nextInt();
int result;
int x = sc.nextInt();
result = calculate(num, x, 0, 1);
System.out.println("#" + N + " " + result);
}
}
static int calculate(int num, int x, int i, int result) {
if(x==i) return result;
return calculate(num, x, i+1, result * num);
}
}

import java.util.HashMap;
import java.util.Scanner;
import java.io.FileInputStream;
import java.util.Set;
class Solution
{
static char[][] arr;
public static void main(String args[]) throws Exception
{
Scanner sc = new Scanner(System.in);
int T;
T=10;
for(int test_case = 1; test_case <= T; test_case++)
{
int N = sc.nextInt();
int x = sc.nextInt();
int y = sc.nextInt();
int answer = 1;
for(int i=0; i<y; i++) {
answer *= x;
}
System.out.println("#"+test_case+" "+answer);
}
}
}
