fork(1) download
  1. #include <stdio.h>
  2.  
  3. f(char*s){int w,l,b,i,j;for(;s[w]-32;w++);for(;s[l];l++)printf("",b),b+=s[l]==32;for(;i<w;i++){for(j=0;j<(l-b)/w;j++)putchar(s[i+j*-~w]);putchar(" "[i+1==w]);};}
  4. g(char*s){int w,l,b,i,j;for(;s[w]-32;w++);for(;s[l];l++)b+=s[l]==32;for(;i<w;i++){for(j=0;j<(l-b)/w;j++)putchar(s[i+j*-~w]);putchar(" "[i+1==w]);};}
  5.  
  6. int main(void) {
  7. f("hello world");
  8. puts("");
  9. f("car dog man yay");
  10. puts("");
  11. f("money taken trust");
  12. puts("");
  13. //g("hello world"); Causes segfault
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
hw eo lr ll od
cdmy aoaa rgny
mtt oar nku ees ynt