fork download
  1. /* you can see `0a` of end-of-line, which is ascii code of '\n' */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. int main(void)
  7. {
  8. char buf;
  9.  
  10. while (1)
  11. {
  12. scanf("%c", &buf);
  13. if (buf == 'q')
  14. break;
  15.  
  16. printf("%02x", buf);
  17.  
  18. putchar((buf == '\n') ? '\n' : ' ');
  19. }
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2252KB
stdin
#include <stdio.h>
#include <string.h>

int main(void)
{
	return 0;
}

q
stdout
23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 0a
23 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67 2e 68 3e 0a
0a
69 6e 74 20 6d 61 69 6e 28 76 6f 69 64 29 0a
7b 0a
09 72 65 74 75 72 6e 20 30 3b 0a
7d 0a
0a