Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- char str[103][103];
- int main()
- {
- int i=0,len,mx=0,j,k;
- while(gets(str[i]))
- {
- if(str[i][0]=='\0')
- break;
- len = strlen(str[i]);
- mx = max(mx,len);
- i++;
- }
- for(j=0; j<mx; j++)
- {
- for(k=i-1; k>=0; k--)
- {
- if(j>=strlen(str[k]))
- {
- printf(" ");
- }
- else
- {
- printf("%c",str[k][j]);
- }
- }
- puts("");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment