Language: C++

import Control.Applicative
import Control.Monad
import Data.List

solve :: Int -> [Int]
solve n = reverse $ solve' n primes []
    where
        range = truncate $ sqrt $ fromIntegral n
        primes = filter isPrime [2..range]

isPrime :: Int -> Bool
isPrime n = null [x | x <- [2.. truncate $ sqrt $ fromIntegral n], n `rem` x == 0]

solve' :: Int -> [Int] -> [Int] -> [Int]
solve' _ [] ans = ans
solve' 0 _ ans = ans
solve' n primes@(x:xs) ans =
    if n `rem` x == 0
    then solve' (n `div` x) primes (x:ans)
    else solve' n xs ans

readLnInt :: IO Int
readLnInt = readLn

main :: IO ()
main = do
    n <- readLnInt
    let answer = foldl' (++) "" (map ((" " ++) . show) (solve n))
    putStrLn $ show n ++ ":" ++ answer

Compiler output:
a.cc:6:26: warning: missing terminating ' character
    6 | solve n = reverse $ solve' n primes []
      |                          ^
a.cc:6:26: error: missing terminating ' character
    6 | solve n = reverse $ solve' n primes []
      |                          ^~~~~~~~~~~~~
a.cc:9:34: error: too many decimal points in number
    9 |         primes = filter isPrime [2..range]
      |                                  ^~~~~~~~
a.cc:12:29: error: too many decimal points in number
   12 | isPrime n = null [x | x <- [2.. truncate $ sqrt $ fromIntegral n], n `rem` x == 0]
      |                             ^~~
a.cc:12:70: error: stray '`' in program
   12 | isPrime n = null [x | x <- [2.. truncate $ sqrt $ fromIntegral n], n `rem` x == 0]
      |                                                                      ^
a.cc:12:74: error: stray '`' in program
   12 | isPrime n = null [x | x <- [2.. truncate $ sqrt $ fromIntegral n], n `rem` x == 0]
      |                                                                          ^
a.cc:14:6: warning: missing terminating ' character
   14 | solve' :: Int -> [Int] -> [Int] -> [Int]
      |      ^
a.cc:14:6: error: missing terminating ' character
   14 | solve' :: Int -> [Int] -> [Int] -> [Int]
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:6: warning: missing terminating ' character
   15 | solve' _ [] ans = ans
      |      ^
a.cc:15:6: error: missing terminating ' character
   15 | solve' _ [] ans = ans
      |      ^~~~~~~~~~~~~~~~
a.cc:16:6: warning: missing terminating ' character
   16 | solve' 0 _ ans = ans
      |      ^
a.cc:16:6: error: missing terminating ' character
   16 | solve' 0 _ ans = ans
      |      ^~~~~~~~~~~~~~~
a.cc:17:6: warning: missing terminating ' character
   17 | solve' n primes@(x:xs) ans =
      |      ^
a.cc:17:6: error: missing terminating ' character
   17 | solve' n primes@(x:xs) ans =
      |      ^~~~~~~~~~~~~~~~~~~~~~~
a.cc:18:10: error: stray '`' in program
   18 |     if n `rem` x == 0
      |          ^
a.cc:18:14: error: stray '`' in program
   18 |     if n `rem` x == 0
      |              ^
a.cc:19:15: warning: missing terminating ' character
   19 |     then solve' (n `div` x) primes (x:ans)
      |               ^
a.cc:19:15: error: missing terminating ' character
   19 |     then solve' (n `div` x) primes (x:ans)
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:15: warning: missing terminating ' character
   20 |     else solve' n xs ans
      |               ^
a.cc:20:15: error: missing terminating ' character
   20 |     else solve' n xs ans
      |               ^~~~~~~~~~
a.cc:28:23: warning: missing terminating ' character
   28 |     let answer = foldl' (++) "" (map ((" " ++) . show) (solve n))
      |                       ^
a.cc:28:23: error: missing terminating ' character
   28 |     let answer = foldl' (++) "" (map ((" " ++) . show) (solve n))
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Applicative
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'