fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <inttypes.h>
  4.  
  5. int main(void)
  6. {
  7.  
  8. int8_t n[8] = "98765432";
  9. uint64_t* a = (uint64_t *)n;
  10. *a =((*a & 0x0F000F000F000F00)>>8) +
  11. ((*a & 0x000F000F000F000F)*10);
  12.  
  13. *a = 1000000 * ((*a >> 0 ) & 0xFF) +
  14. 10000 * ((*a >> 16) & 0xFF) +
  15. 100 * ((*a >> 32) & 0xFF) +
  16. ((*a >> 48) & 0xFF);
  17. //little-endian only. Можно переделать под big-endian
  18. printf("%"PRIu64, *a);
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
98765432