fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. char buf[100];
  8. int i,j,n;
  9. fgets(buf,sizeof buf,stdin);
  10. n = strlen(buf);
  11. if(n>0 && buf[n-1] == '\n')
  12. buf[n-1] = '\0';
  13.  
  14. for(i=0;i<n;i++)
  15. {
  16. j = i;
  17. while(j--)
  18. printf(" ");
  19. printf("%c\n",buf[i]);
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 2160KB
stdin
gopi
stdout
g
 o
  p
   i