fork download
  1. #include <iostream>
  2. #include <string.h>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. string ptmpBuffer = "0095";
  9. unsigned int iCellId = 0;
  10. char trunk_id[7];
  11. std::stringstream stream;
  12. stream << ptmpBuffer;
  13. stream >> std::hex >> iCellId;
  14. cout<<iCellId<<endl;
  15. //CPF_TRACE(i_appContext.getLogger(), afc::LogLevel::ms_DEBUG,"AT : In Decimal: <1> ", iCellId);
  16.  
  17. sprintf( trunk_id, "%03d%03d", ( iCellId & 0x7800 ) >> 11, ( iCellId & 0x07f8 ) >> 3 );
  18.  
  19. cout<<trunk_id;
  20. return 0;
  21. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
149
000018