Untitled

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
663 B
1
Indexable
Never
 ifstream file("input.txt");
    string temp;
    getline(file, temp);
    cout << temp;
    stringstream ss(temp);
    string type;
    getline(ss, type, ':');
    cout << endl
         << type;
    string name;
    getline(ss, name, '(');

    name.erase(0, 1);
    name.erase(name.size() - 1, 1);
    cout << endl
         << name;
    string address;
    getline(ss, address, ')');
    cout << endl
         << address;
    string chungChi;
    getline(ss, temp, '[');
    getline(ss, chungChi, ']');
    cout << endl
         << chungChi;
    string soBaoCao;
    getline(ss, temp, '<');
    getline(ss, soBaoCao, '>');
    cout << endl
         << soBaoCao;