topcoder

topcoder SRM400 div2

250: class Chessboard { public: string changeNotation( string cell ) { string table = "abcdefgh"; bool flag = false; rep(i,cell.size()){ if(isdigit(cell[i])) continue; else flag = true; } string res; if(!flag){ //only digit int s = atoi(ce…

topcoder SRM144 div2

最近始めたので過去問を解いて行きます。200: 秒が与えられるのでそれを時間:分:秒に変換する。sstreamを使った。 class Time { public: string whatTime( int seconds ) { stringstream ss; ss << seconds/3600<<":"<<seconds/60%60<<":"<<seconds%60; string str; ss >> str; return str; } };</seconds/60%60<<":"<<seconds%60;>