import java.io.*;
import java.util.Scanner;
import java.math.*;
class Sort {
public static void main(String args[]) {
class gint {
int N, n, s;
int ggn[];
}
gint gginta=new gint();
gint ggintb=new gint();
gint ggintc=new gint();
int i=0;
int j=0;
char c[];
String ss;
String sggn;
String sggnrev="";
System.out.println("enter the number of maximum digits of the number");
Scanner scan=new Scanner(System.in);
gginta.N=scan.nextInt();
System.out.println("enter the number exact digits of the number ");
gginta.n=scan.nextInt();
System.out.println("enter the sign of the number");
System.out.println("enter the number");
sggn=scan.next();
char temp[];
int l=sggn.length();
for(j=l-1; j >= 0; j--) {
sggnrev= sggnrev+sggn.charAt(j);
}
int x= Integer.parseInt(sggn);
System.out.println(sggnrev);
System.out.println(sggn.length());
int h;
System.out.println(sggn.length());
for (int f=0;f<=sggn.length()-1;f++) {
System.out.println(f);
double y=(int) (x/Math.pow(10, f));
double z=(int) (x/Math.pow(10, f+1));
double w= y-(z*10);
System.out.println("power"+i+"= "+(int) y +"-"+(int)z*10+"="+w);
h= (int) w;
gginta.ggn[f]=h;
System.out.print(gginta.ggn[l-1]);
l--;
}
for (i=0;i<=sggn.length()-1;i++) {
if (sggn.length()!=gginta.n) {
System.out.println("number not in range....enter the number again ... ");
do {
System.out.println("number not in range....enter the number again ... ");
System.out.println("enter the number");
sggn=scan.next();
} while (sggn.length()!=gginta.n);
}
}
}
this code is basically taking a number as a string and i am aiming to get each index of the string and transfer its value to the index of an integer array so that i have my number is in the integer array and each index of the array represents a digit of the number