1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
#include <iostream> #include <string.h> #include <fstream> using namespace std; char s[105][105]; int main() { int k=0; int len,mx=0; //ofstream out; //out.open("out.txt"); for(int i=0;i<105;i++) for(int j=0;j<105;j++) s[i][j]=' '; while(gets(s[k])) { len = strlen(s[k]); s[k][len] =' '; if(len>mx) mx = len; k++; } for(int j=0;j<mx;j++) { for(int i=k-1;i>=0;i--) { cout<<s[i][j]; //out<<s[i][j]; } cout<<endl; //out<<endl; } //out.close(); return 0; } |