You are viewing a single comment's thread. Return to all comments →
Without any 2D array.
void encryption(string s) { int n = s.length(); int x = floor(sqrt(n)); int y = ceil(sqrt(n)); int k=0; if((x*y)<n) x++; for(int i=0; i<y; i++){ for(int j=0; j<x; j++){ k=i+(j*y); if(s[k]!='\0') cout<<s[k]; } cout<<" "; } }
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 →
Without any 2D array.