Advertisement
palmerstone

Untitled

Jun 2nd, 2011
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4.  
  5. char str[5000][5000];
  6. int main()
  7. {
  8. int t, i, j, k, l, a, b, c, d, x, y, z, sum, count, len, max;
  9. char str2[5000];
  10. j = 0, max = 0;
  11. for (; ;)
  12. {
  13. gets (str2);
  14. if (feof(stdin))
  15. break;
  16.  
  17. len = strlen(str2);
  18. if (len >= max)
  19. {
  20. max = len;
  21. }
  22. strcpy(str[j], str2);
  23. str[j][len] = '\0';
  24. j++;
  25. }
  26.  
  27. for (k = 0; k < max; k++)
  28. {
  29. for (l = j - 1; l >= 0; l--)
  30. {
  31. if ( (str[l][k] != '\0') && str[l][k] != ' ' )
  32. {
  33. printf("%c", str[l][k]);
  34. }
  35. }
  36. printf("\n");
  37. }
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement