fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned short x, y;
  5. unsigned base = 16;
  6.  
  7. char *input = "f5+";
  8.  
  9. x = strtol(input, NULL, base);
  10. x /= base;
  11.  
  12. y = strtol(input, NULL, base);
  13. y %= base;
  14.  
  15. printf("%u\n%x\n", x+y, x+y);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
20
14