# include <iostream>
# include <algorithm>
# include <string>
usingnamespace std;
struct name
{
string sentence ;
} ;
int main ()
{
name array [100] ;
int counter = 0 , index [10000] ;
while (counter < 2 && getline (cin , array[counter].sentence ))
{
index [counter] = array[counter].sentence.length () ;
counter ++ ;
}
sort (index , index+counter) ;
for (int i=0 ; i<index[counter-1]-index[counter-2] ; i++ )
{
array [1].sentence[index[counter-2]] = ' ' ; // this is not working.....I need to put a space int that location
}
for (int j=0 ; j< index [counter-1]; j++)
{
for (int i=0 ; i<=counter-1 ; i++)
{
cout << array [counter-1-i].sentence[j];
}
cout << endl;
}
system ("pause");
}
Blood for the blood god!
Science for the science god!!
SB
cl
io
eo
nd
c
ef
o
fr
o
rt
h
te
h
eb
l
so
co
id
e
ng
co
ed
!
<-Here is your space (instead of 'g' in original)
o
d
!
!