You are viewing a single comment's thread. Return to all comments →
/Following is my code ,,,, Please go though it,,,/
int main() {
int i = 0 , k = 0 , j , l , r , n = 0; char ch; char temp[101]; char str[101]; char res[101][101]; while(ch != EOF) { ch = getchar(); temp[i++] = ch; } temp[i] = '\0'; for(i = 0 ; temp[i] != '\0' ; i++) { if(temp[i] == ' ') continue; str[k++]= temp[i]; } str[k] = '\0'; l = ceil(sqrt(k)); r = floor(sqrt(k)); //if(l * r == k - 1) //{ for(i = 0 ; i < r ; i++) { for(j = 0 ; j < l ; j++) { res[i][j] = str[n++]; } } for(i = 0 ; i < l; i++) { for(j = 0 ; j < r ; j++) { printf("%c" , res[j][i]); } printf(" "); } return 0; //} /*else { }*/
}
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 →
/Following is my code ,,,, Please go though it,,,/
include
include
include
include
int main() {
}