/*
* TestTengXun.java
* Version 1.0.0
* Created on 2017年12月2日
* Copyright ReYo.Cn
*/
package reyo.sdk.utils.test.w;

import java.util.Scanner;

public class Testzhi {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入一个数:");
		long number = in.nextLong();
		System.out.print(number + "=");
		int i = 1;
		while (i < number) {
			if (number % i == 0 && i == 1) {
				System.out.print(i + "x");
				number /= i;

			} else if (number % i == 0 && i != 1) {
				System.out.print(i + "x");
				number /= i;
				continue;
			}
			i++;
		}
		System.out.print(i);
	}
}

 

相关文章:

  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
猜你喜欢
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-11-29
  • 2021-09-05
  • 2021-06-14
相关资源
相似解决方案