我是靠谱客的博主 落后彩虹,这篇文章主要介绍Finding the factors of an integer,现在分享给大家,希望可以做个参考。

代码:

import java.util.Scanner;
public class Ten_six {

	public static void main(String[] args) {
		System.out.println("Enter an int value: ");
		Scanner cin = new Scanner(System.in);
		int a = 2, x;
		double num = 1;
		x = cin.nextInt();
		while (a<=x) {
			while (x % a == 0) {
				x = x / a;
				System.out.print(+a);
				System.out.print(" ");
			}
			a++;
		}
	}
}


运行结果:


 

最后

以上就是落后彩虹最近收集整理的关于Finding the factors of an integer的全部内容,更多相关Finding内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(122)

评论列表共有 0 条评论

立即
投稿
返回
顶部