Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<functional>
- #include<bitset>
- #include<algorithm>
- #include<fstream>
- #include<string>
- #include<stdio.h>
- #include<iomanip>
- #include<sstream>
- #include<cmath>
- #include<vector>
- #include<queue>
- #include<deque>
- #include<stack>
- #include<set>
- #include<map>
- typedef unsigned long long ull;
- typedef long long ll;
- typedef long double ld;
- #define PI 3.14159265
- #define eps 1e-8
- using namespace std;
- void fast(){
- ios_base::sync_with_stdio(0);
- cin.tie(NULL), cout.tie(NULL);
- }
- int main()
- {
- string s;
- cin >> s;
- int stroka = ceil(s.length()/20.0);
- int stolbec = ceil(s.length()/(float)stroka);
- cout << stroka << " " << stolbec << endl;
- int dl = stroka*stolbec;
- int zv = dl - s.length();
- char **a;
- a = new char*[stroka];
- for (int i=0; i<stroka; i++)
- {
- a[i] = new char[stolbec];
- }
- for (int i=0; i<stroka; i++)
- {
- for (int j=0; j<stolbec; j++)
- {
- a[i][j]='0';
- }
- }
- int str=0;
- int stb=0;
- while (zv>0)
- {
- a[str][stb]='*';
- zv--;
- str++;
- if (str == stroka-1)
- {
- str=0;
- stb++;
- }
- }
- int kk=0;
- for (int i=0; i<stroka; i++)
- {
- for (int j=0; j<stolbec; j++)
- {
- if (a[i][j]!='*')
- {
- cout << s[kk++];
- }
- else cout << a[i][j];
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement