Untitled
unknown
plain_text
4 years ago
888 B
5
Indexable
package practice; import java.util.Scanner; public class Mahi { public static int reversible(int num) { int temp1 = num; int rev = 0; int val=0; while (num != 0) { rev = rev * 10 + num % 10; num = num / 10; } if (rev == temp1) { val=1; } else { String s=String.valueOf(temp1); char st[]=s.toCharArray(); int in[]=new int[st.length]; for (int i=0;i<st.length;i++){ int number = Integer.parseInt(String.valueOf(st[i])); in[i]=number*5; System.out.println(in[i]); } } return val; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num = scan.nextInt(); reversible(num); } }
Editor is loading...