⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pku2325.java

📁 这是ACM 方面的资料 是PKU的 北京大学的出来的
💻 JAVA
字号:
import java.io.*;
import java.util.*;
import java.lang.String;
import java.math.BigInteger;
import java.lang.Integer;

class Main
{
	public static void main(String args[]) throws Exception
	{
		Scanner cin=new Scanner(System.in);
		String s;
		BigInteger bi;
		int n_num[] = new int[10];
		int i, j, all;
		BigInteger one = new BigInteger("1");
		
		while (true)
		{
			s = cin.next();
			
			if (s.equals("-1"))
			{
				break;
			}
			
			bi = new BigInteger(s);
			
			if(bi.equals(BigInteger.valueOf(0)))
			{
				System.out.println("10");
				continue;
			}
			
			if(bi.equals(BigInteger.valueOf(1)))
			{
				System.out.println("11");
				continue;
			}

			for (i = 9, all = 0; i > 1; i--)
			{
				n_num[i] = 0;
				
				while (bi.mod(one.multiply(BigInteger.valueOf(i))).intValue() == 0)
				{
					bi = bi.divide(BigInteger.valueOf(i));
					n_num[i]++;
					all++;
				}
			}
			
			if(bi.compareTo(new BigInteger("10")) >= 0)
			{
				System.out.println("There is no such number.");
				continue;
			}
			
			if(all==1)
			{
				System.out.print('1');
			}
			
			for(i = 2; i < 10; i++)
			{
				for (j = 0; j < n_num[i]; j++)
				{
					System.out.print(i);
				}
			}
			System.out.println();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -