fork(1) download
  1. #include <stdio.h>
  2. void f877(const char *p) {
  3. int r = 0, c = 0;
  4. for (; *p; p++)
  5. if (*p == '\n') r++, c = 0;
  6. else if (isspace(*p)) c++;
  7. else printf("[%c, %d, %d]\n", *p, c++, r);
  8. }
  9. int main() {
  10. f877("a b c\n\nd");
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
[a, 0, 0]
[b, 2, 0]
[c, 4, 0]
[d, 0, 2]