On lines 12-16, you read the entire file to the end. On line 18, you have three syntax errors. On lines 19-25, you use the same file stream that is already at the end of the file.
Size of stack allocated arrays should be known at compile time, i.e. you can do this:
1 2
constint i = 10;
int array[i];
but not that:
1 2 3
int i;
std::cin >> i;
int array[i];
Name sort is misleading: it does not actually sorts anything.
Using parallel arrays is prone to errors, better to group your fields in struct and use single array.