hiho week 88 register

Ended

Participants:577

Verdict:Accepted
Score:100 / 100
Submitted:2016-03-06 12:10:18

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Main {
    public static int[] factorize(int number) {
        int[] temp = new int[200];
        int size = 0;
        for (int i = 1i <= number++i) {
            if (number % i == 0) {
                temp[size++= i;
            }
        }
        int[] result = new int[size];
        for (int i = 0i < result.length++i) {
            result[i= temp[i];
        }
        return result;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int p = in.nextInt();
        int q = in.nextInt();
        int[] xCoordinates = factorize(p);
        int[] yCoordinates = factorize(q);
        for (int i = 0i < xCoordinates.length++i) {
            for (int j = 0j < yCoordinates.length++j) {
                System.out.println(xCoordinates[i+ " " + yCoordinates[j]);
            }
        }
        in.close();
    }
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX