Guest User

Untitled

a guest
May 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1.  
  2. #include <cstdlib>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char *argv[])
  8. {
  9. char z[25];
  10. char tab[5][5];
  11. int l=0;
  12. cin.getline(z, 25);
  13. for (int i=0; i<5; i++)
  14. {
  15. for (int j=0; j<5; j++)
  16. {
  17. if (l<strlen(z))
  18. {
  19. if (z[i]==' ')
  20. tab[i][j]=z[l];
  21. l++;
  22. }
  23. else
  24. tab[i][j]='_';
  25. }
  26. }
  27.  
  28. for (int i=0; i<5; i++)
  29. {
  30. for (int j=0; j<5; j++)
  31. {
  32. cout << tab[i][j] << " ";
  33. }
  34. cout << endl;
  35. }
  36.  
  37. system("PAUSE");
  38. return EXIT_SUCCESS;
  39. }
Add Comment
Please, Sign In to add comment