The following code snippet (in c++) shows how to get the prime factors of any integer:

#include <iostream>

struct Vec2 {
    int x, y;
};

bool IsPrime(int nr) {
    for (int d = 2; (d * d)  0) {
            std::cout

Add your comment now