string rotate( string s ) { replace(s.begin(), s.end(), '/', ' '); ISS iss(s); int hh, mm; iss >> hh >> mm; OSS oss; oss << setw(2) << setfill('0') << mm << "/" << setw(2) << setfill('0') << hh; return oss.str(); }
string convert( VS list ) { OSS oss; for ( VS::iterator it_i = list.begin(); it_i != list.end(); ++ it_i ) { oss << *it_i; if ( it_i + 1 != list.end() ) oss << " "; } return oss.str(); }
/** * Print the transformation into a string. **/ std::string toString(bool details = false) const { const size_t l = _perm.size(); if (l == 0) return "Permutation[empty]"; OSS os; os << "Permutation[0," << (l - 1) << "]"; if (details) { os << "\n"; for (int i = 0;i < (int)l;i++) { os << i << "\t -> \t" << _perm[i] << "\n"; } } return os.str(); }
string LTOS(const LL x) {OSS ss;ss << x;return ss.str();}