// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
    ifstream f("C:\\test.txt");
    string line;
    while(getline(f,line))
    {
        stringstream ss(line);
        string name = "";
        string part;
        ss >> part;
        while(ss.peek() != EOF)
        {
            if(name.length() > 0) name += " ";
            name += part;
            ss >> part;
        }
        stringstream ss2(part);
        int num;
        ss2 >> num;
        cout << name << endl;
        cout << num << endl;
    }
    return 0;
}
