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

📄 perfectnum.java

📁 有大量的java的实例
💻 JAVA
字号:
// 找完全数(等于其所有因子和(包括1但不包括这个数本身)的数 ,例6=1*2*3  6=1+2+3
public class PerFectNum
{
public static void main(String args[])
{
	int count=1;
	for(int i =1;i<10000;i++)
	{											 
		int y=0;

		for(int j=1;j<i;j++)
			if(i%j==0)  
                             y+=j;
		if(y == i)
		{
			System.out.print(i+String.valueOf('\t'));
//                        System.out.print(i+"\t");
			count++;
			if(count%3==0)	
                              System.out.println();
		}
	}
}
}

⌨️ 快捷键说明

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