Guest User

Untitled

a guest
Jun 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. #define N_MAX 1000
  5.  
  6.  
  7.  
  8.  
  9. main()
  10. {
  11.  
  12.  
  13.  
  14. char s[]="testing this out and seeing how it goes";
  15. char s2[N_MAX][N_MAX];
  16.  
  17. int n, i, j, k, m;
  18. n=strlen(s);
  19.  
  20. j=0;
  21. for(i=0; i<s;i++)
  22. {
  23. if (s[i]==' '){
  24. j++;
  25. }
  26. else s2[j][i]=s[i];
  27. }
  28.  
  29.  
  30.  
  31. for(k=0; k<n; k++){
  32. for(m=0; m<n; m++){
  33.  
  34. printf("%c", s2[k][m]);
  35. }
  36.  
  37. }
  38.  
  39.  
  40.  
  41. system ("pause");
  42.  
  43. }
Add Comment
Please, Sign In to add comment