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[] = {'9', '8', '7', '6', '5', '4', '3', '2'};
  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.  
  19. printf("%"PRIu64, *a);
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 1832KB
stdin
Standard input is empty
stdout
98765432