题目描述
blablabla
样例
blablabla
import java.util.*;
public class Main{
public static void getdiv(int n){
ArrayList<Integer> list = new ArrayList<>();
for(int i = 1 ; i <= n / i ; i++)
{
if(n % i == 0 )
{
list.add(i);
if( n / i != i) list.add(n / i);
}
}
Collections.sort(list);
for(int c : list){
System.out.print(c + " ");
}
System.out.println();
}
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while(n-- > 0)
{
int x = sc.nextInt();
getdiv(x);
}
}
}
blablabla