Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- char z[25];
- char tab[5][5];
- int l=0;
- cin.getline(z, 25);
- for (int i=0; i<5; i++)
- {
- for (int j=0; j<5; j++)
- {
- if (l<strlen(z))
- {
- if (z[i]==' ')
- tab[i][j]=z[l];
- l++;
- }
- else
- tab[i][j]='_';
- }
- }
- for (int i=0; i<5; i++)
- {
- for (int j=0; j<5; j++)
- {
- cout << tab[i][j] << " ";
- }
- cout << endl;
- }
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Add Comment
Please, Sign In to add comment