I need to write a c++ program that expresses a positive integer (between 1 and 1000) as a product of 2 or more prime numbers.

I know how to find the prime factors, but I'm stumped after that. I was thinking of using a bunch of if-then statements which multiply the prime factors until they equal the positive integer, but I have a hunch that there's a much simpiler method