public class Solution { public static void main(String[] args) { System.out.println(qpow(5,6)); } public static int qpow(int x,int n) { int res =1; while(n!=0){ if (1==(1 & n)){ res*=x; } n >>= 1; x*=x; } return res; } }