Need help with data processing

I have a text file with the content like this

ABC 5

EDFS 6

WERT 4

TYHFS 7

What I have to do is read the text and the number then generate the kth permutation sequence of said text(k is the number following the text after the space) then write them on an output file

I know how to generate the sequence but I don't know how to read the text and the number to proceed all 4 lines then write out please help
1
2
3
4
5
6
std::ifstream input("filename");
std::string word;
int number;
while(input >> word >> number){
   //...
}
Topic archived. No new replies allowed.