fork download
  1. f(s,b)char*s;{return*s?f(s+1,*s>b?*s:b):(b-8)%39;}
  2.  
  3. test(const char* input)
  4. {
  5. printf("%36s -> %u\n", input, f((char*)input,0));
  6. }
  7.  
  8. main()
  9. {
  10. test("00000");
  11. test("123456");
  12. test("ff");
  13. test("4815162342");
  14. test("42");
  15. test("codegolf");
  16. test("0123456789abcdefghijklmnopqrstuvwxyz");
  17. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
                               00000 -> 1
                              123456 -> 7
                                  ff -> 16
                          4815162342 -> 9
                                  42 -> 5
                            codegolf -> 25
0123456789abcdefghijklmnopqrstuvwxyz -> 36