fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char *test = "%123";
  5. int len = strlen(test);
  6. int gid = 0;
  7. for (int i = 1; i < len; i++) {
  8. gid = gid * 10 + (test[i] - '0');
  9. }
  10. printf("%d", gid);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
123