Project Euler #63: Powerful digit counts

  • + 0 comments

    Scanner sc=new Scanner(System.in); int n=sc.nextInt(); if(n>0 && n<20){ for(int i=1;i<=19;i++){ int x=(int)Math.pow(i,n); // int y=n; //converted num into string to calculate the no of degits inside of the string
    String str=String.valueOf(x); if(str.length()==n){ System.out.println(x); }else if(str.length()

                    }