It's not so good stylistically. You've sepearated output into two different locations, once in the flip, and once in the return. A better approach would be to have the flip() function return a string object instead of a number, so that the output function can output the zeros.
I personally would take an entirely different approach to doing this. First use
boost::lexical_cast to turn the number into a string and then use std::reverse() to reverse the digits.
std::string flip(int n) { std::string str = boost::lexical_cast<std::string>(n); std::reverse(str.begin(), str.end()); return str;}