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(cell.data());
         int w = s/8; //syou
         int am = s%8; //amari
         stringstream ss;
         ss  << table[am-1] << w+1;
         ss >> res;
         return res;
      }
      else{
         rep(i,8){
            if(cell[0] == table[i]){
               int s = ((cell[1]-'0')-1)*8;
               int w = s+i+1;
               stringstream ss;
               ss << w;
               ss >> res;
               return res;
            }
         }
      }
   }
};

効率悪すぎワロタ。。。。ワロタorz