Factorization game

here is the link for my code


i think i have written correct code,but its giving wrong answer ,i have tried but i am unable to figure out the mistake .

What is your approach?