import java.util.Scanner;
import java.math.BigInteger;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
while(in.hasNext()){
String s;
BigInteger c;
int a,b;
s=in.next();
a=in.nextInt();
b=in.nextInt();
c=new BigInteger(s,a);
s=c.toString(b);
if(s.length()<=7)
System.out.printf("%7s%n",s.toUpperCase());
else
System.out.printf(" ERROR%n");
}
}
}
import java.math.BigInteger;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
while(in.hasNext()){
String s;
BigInteger c;
int a,b;
s=in.next();
a=in.nextInt();
b=in.nextInt();
c=new BigInteger(s,a);
s=c.toString(b);
if(s.length()<=7)
System.out.printf("%7s%n",s.toUpperCase());
else
System.out.printf(" ERROR%n");
}
}
}
Comments
Post a Comment