fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char str[] = "0,228,03,1771,2d6f,55,62";
  7.  
  8. int32_t mnc, mcc, lac, cellid;
  9. if ( sscanf( str, "%*d,%d,%d,%x,%x,%*d,%*d", &mcc, &mnc, &lac, &cellid ) == 4 )
  10. {
  11. printf( "http://o...content-available-to-author-only...d.org/#action=locations.cell&mcc=" );
  12. printf( "%d", mcc );
  13. printf( "&mnc=" );
  14. printf( "%d", mnc );
  15. printf( "&lac=" );
  16. printf( "%d", lac );
  17. printf( "&cellid=" );
  18. printf( "%d", cellid );
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
http://o...content-available-to-author-only...d.org/#action=locations.cell&mcc=228&mnc=3&lac=6001&cellid=11631