import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
BigInteger arr[][]= new BigInteger[11][26];
for(int i=1;i<11;i++){
arr[i][0]=BigInteger.ONE;
BigInteger temp=arr[i][1]=BigInteger.valueOf(i);
for(int j=2;j<26;j++){
arr[i][j]=arr[i][j-1].multiply(temp);
}
}
while(true) {
String []str=br.readLine().split(" ");
int i=Integer.parseInt(str[0]);
int j=Integer.parseInt(str[1]);
if(i==0 &&j==0)
break;
sb.append(arr[i][j]).append("\n");
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
BigInteger arr[][]= new BigInteger[11][26];
for(int i=1;i<11;i++){
arr[i][0]=BigInteger.ONE;
BigInteger temp=arr[i][1]=BigInteger.valueOf(i);
for(int j=2;j<26;j++){
arr[i][j]=arr[i][j-1].multiply(temp);
}
}
while(true) {
String []str=br.readLine().split(" ");
int i=Integer.parseInt(str[0]);
int j=Integer.parseInt(str[1]);
if(i==0 &&j==0)
break;
sb.append(arr[i][j]).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment