//java solution
import java.util.*;
import java.util.regex.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import java.math.*;
import java.text.*;
class Main
{
public static void main (String args[]) // entry point from OS
{
Main myWork = new Main(); // create a dinamic instance
myWork.Begin(); // the true entry point
}
void Begin()
{
Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter pr=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
BigDecimal r=new BigDecimal("0");
int n,i,ix;
String t;
//default delimiter : "\\s+"
// that means spaces , tabs , newlines(form feeds , carriage returns)
// are skipped
while(sc.hasNext())
{
r=sc.nextBigDecimal();
n=sc.nextInt();
r=r.pow(n);
r=r.stripTrailingZeros();
t=r.toPlainString();
for(i=0;;i++)
{
if(t.charAt(i)!='0')
{
ix=i;break;
}
}
t=t.substring(ix);
pr.println(t);
}
pr.close();
sc.close();
}
}
import java.util.*;
import java.util.regex.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.*;
import java.math.*;
import java.text.*;
class Main
{
public static void main (String args[]) // entry point from OS
{
Main myWork = new Main(); // create a dinamic instance
myWork.Begin(); // the true entry point
}
void Begin()
{
Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter pr=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
BigDecimal r=new BigDecimal("0");
int n,i,ix;
String t;
//default delimiter : "\\s+"
// that means spaces , tabs , newlines(form feeds , carriage returns)
// are skipped
while(sc.hasNext())
{
r=sc.nextBigDecimal();
n=sc.nextInt();
r=r.pow(n);
r=r.stripTrailingZeros();
t=r.toPlainString();
for(i=0;;i++)
{
if(t.charAt(i)!='0')
{
ix=i;break;
}
}
t=t.substring(ix);
pr.println(t);
}
pr.close();
sc.close();
}
}
No comments:
Post a Comment