Import java.util.*;
Class Work7
{
public static void Main (string[] args)
{//Enter up to 1 billion digits
string[] str = new string[]{"10-bit", "hundred", "thousand", "million-bit", "100,000-bit", "Million Dollar", "Chiwan", "million-bit", "1 billion-bit", "ranked", "Chi"};
System.out.println ("Please enter a number");
Scanner sac = new Scanner (system.in);
Accept the number of user input
Long sum = Sac.nextint ();
Long sum2=sum;
int a=0;
for (int i = 0; i<32; i++)
{
Determine how many digits the user has entered
if (sum/10>0) {
SUM=SUM/10;
a++;
}else{
Break
}
}
if (sum2<10)
{
Long k =sum;
System.out.println ("Only bits of this number are" +k);
}else{
The number of user input is decomposed.
for (int i = 0; i<=a; i++)
{
if (i==0)
{
Long C = sum2%10;
SYSTEM.OUT.PRINTLN ("The digit of this number is" +c);
}else if (i<a) {
Here is a strong turn to this function comes out of double;
Long new1= (Long) Math.pow (ten, I);
Parameter description: M is the number of the requesting party, N is the second-party number
Long B = sum2/new1%10;
System.out.println ("The number of the first +str[i-1]+" is "+b");
}else{
Long new2= (Long) Math.pow (ten, I);
Long h = sum2/new2%10;
System.out.println ("The number of the first +str[i-1]+" is "+h");
}
}
}
}
}
Simple decomposition of positive integers in Java.