/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author lenovo
*/
public class PrintWanShu {
int getWanShu()
{
int i,j,k=0;
int sum=0;
int a [];
a=new int[50];
for(i=1;i<=1000;i++)
{
for(j=1;j<i/2+1;j++)
{
if(i%j==0)
{
a[k++]=j;
sum+=j;
}
if(sum==i)
System.out.println(" "+i);
}
}
return i;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author lenovo
*/
public class Test {
public static void main(String args[]){
PrintWanShu a= new PrintWanShu();
a.getWanShu();
}
}
10-02
10-02
10-02