I have this problem, and i need some help and instructions. I previously tried to put strings in an array, but i couldn't modify the first index in the string that is in the array. I changed my code later.
url:http://www.cs.rit.edu/~icpc/questions/2010/WNEC_2010.pdf
EDIT: Anyone can suggest a function that sorts the inputs vertically according to the order given by the user? I made this one
void order(string order, char index[][15]){
int counter=0,line=0,i=0,j=0;
for(i=0;i<=15-1;i++)
{for(j=0;j<=15-1;j++)
{
if(index[j][i]==order[counter])
{ for (int b=0;b<=15-1;b++)
index[i][b]=index[j][i];
continue;}
else continue;}
counter++;
}
Sample Input
C M H B F
hccbmf
mhc
hccfc
cfh
hbcf
mbc
@
Sample Output
Cfh
Mhc
Mbc
Hccbmf
Hccfc
Hbcf
"
Please use code tags next time. They look like <> to your right.
Maybe this is what you're looking for. The standard library provides the sort function.