import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for (int i = 1 ; i <= N ; i++)
factors(i);
}
public static void factors(int n)
{
int sum = 0;
ArrayList<Integer> arr = new ArrayList<>();
for (int i = 1 ; i <= Math.sqrt(n) ; i++)//因数以数的开发为界限分开
if (n % i==0)
{
int a = n/i;
arr.add(i);
if(i!=1)//排除数本身
arr.add(a);
}
Collections.sort(arr);//数组排序
for (int a:arr)
{
sum += a;
}
if(n == sum && n!=1)
{
String str = "";
for (int a:arr)
{
str += String.valueOf(a)+" ";
}
System.out.println(n + " its factors are "+str);//字符串拼接
}
}
}
0.0分
0 人评分