/**
 * @author Daniel "3ICE" Berezvai
 */
public class Pow {

	public double pow(int a, int b){
		double total=1;
			for(int i=1;i<=b;i++){
				total*=a;
			}
	return total;
	}

	public static void main(String[] args) {
		if(args.length!=2){
			System.out.println("Hello, please give me two integers as a command line argument.");
		}else{
			int a=Integer.parseInt(args[0]);
			int b=Integer.parseInt(args[1]);
			double total=1;
			if(b>=0){
				for(int i=1;i<=b;i++){
					total*=a;
				}
				System.out.println("Power of " + a + " ^ " + b + " = " + total);
			}else{
				b=-b;
				for(int i=1;i<=b;i++){
					total*=a;
				}
				System.out.println("Power of 1/" + a + "^" + b + " = " + (1/total));
			}
		}
	}
}
