package think;
import java.util.ArrayList;
import java.util.*;
import java.io.*;
public class think{
public static void main(String[] args){
int num;
List<Integer> a = new ArrayList<Integer>();
Scanner sc = new Scanner(System.in);
sf s = new sf();
num = sc.nextInt();
while(num > 10){
num = s.a(num);
}
System.out.println(num);
}
}
class sf{
int y;
int count = 1;
public int a(int x){
count = 1;
while(x > 10){
y = x % 10;
x = x / 10;
count = count * y;
}
count = count * x;
//while(count > 10){
//y = count % 10;
//int i = count / 10;
//count = i * y;
//}
//System.out.println(count);
return count;
}
}
对一个数进行若干变换直至变成个位数
最新推荐文章于 2024-07-13 20:53:14 发布