fork(2) download
  1. #include <stdio.h>
  2.  
  3. t;x(char*s){*s&1&&(t+=2);return--t?*s&&x(s+1):*s&&!1[s];}
  4.  
  5.  
  6. int main(void) {
  7. char text[100];
  8. while ( scanf("%s", text) != EOF ) {
  9. printf("%d\n", x(text));
  10.  
  11. }
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2160KB
stdin
ab
aaabbb
abbbbb
aaaab
aabaabb
abab
a
stdout
1
1
0
0
0
0
0