Two test cases is wrong

The two test cases are wrong.
why it shows . what is the problem with it .
Sir

Hey @sb8031151_af528e7b895c738c The only problem with your code is that instead of taking int input just take long datatype input. Since constraints on ‘n’ can be very large.

Sir. Now I have changed whatever you say but still first two cases are wrong.

Hey @sb8031151_af528e7b895c738c There is one more silly mistake when you are taking input you have to use nextLong but you have used :
long n=scn.nextInt();
change it to :
long n=scn.nextLong();

Sir, I have done whatever you said but still same issue.

Hey @sb8031151_af528e7b895c738c You are getting wrong answer bcoz you are everytime taking cube of the current digit but it is not cube always instead it is length of the number. for eg :
1634 is an Armstrong number as 1634 = 1^4 + 6^4 + 3^4 + 4^4 here you have taken power 4 not 3.
another example 16345 is not an Armstrong number as 1634 = 1^5 + 6^5 + 3^5 + 4^5+5^5 here power 5 is taken not 3.
So instead of writing
sum=sum+rrr;
You should write :
sum = sum + (int)Math.pow(r,x);
// X here is the length of original number.
Corrected code will be :

import java.util.*;
public class Main {
    public static void main(String args[]) {
		 Scanner scn=new Scanner(System.in);
       long n=scn.nextLong();

       System.out.println(armstrong(n));

    }

	  public static boolean armstrong(long n){
       long temp=n;
	   //Storing temp in string also so that it will be easy to get the length of number.
	   String lengthcheck = String.valueOf(temp);
	   int x = lengthcheck.length();
      
      long  sum=0;

       while(n!=0){
           long r=n%10;
           n=n/10;
           sum = sum +(int)Math.pow(r,x);


       }

       boolean fl;
       if(sum==temp){
            fl=true;
           

       }else{
            fl=false;
       }

    return fl;
   }
}```

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.