You are viewing a single comment's thread. Return to all comments →
I have the same approach with you, why everybody have to do it the hard way?
int main(){ string s; cin >> s; auto n = s.size(); int row = round(sqrt(n)); int column; if (row >= sqrt(n)) column = row; else column = row + 1; for(int j=0;j<column;++j) { for(int i=j; i<n;i+=column)cout << s[i]; cout << ' '; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
I have the same approach with you, why everybody have to do it the hard way?