I had come over another issue with STL.
I am trying to write a program that takes a number 'n' (1 <= n <= 10.000) and prints the "decomposition into prime factors" (I know that the translation to English isn't good).
The program doesn't show any errors or warnings at compilation, but it looks like it gets stuck or goes into an infinite loop, as it doesn't show any message in the console window and neither does it modify the output file.
You have an infinite loop starting at line 25, and your OS is too stupid to notice and kill the program for you.
Either way though, you need to rethink how you are decomposing n into prime factors. Your output, for example, should be
32 × 51
since 3 × 3 × 5 = 45.
Using the map is smart. The way you are checking for primes and factors is confused. As you are figuring it out, remember that it is OK to modify n. Hint:
1 2 3 4 5 6 7 8 9 10 11 12
for every prime number p from 2 to (n / 2) AND while (n != 0)
if p evenly divides n
update the map with this simple code:
m[ p ] += 1;
n /= p;
write the output using lines 40 through 44 as you have it already