Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void second()
- {
- ifstream file("Example.txt");
- string name;
- string iq;
- char c;
- string line;
- while (getline(file, line))
- {
- for (int i = 0; i < line.length(); i++)
- {
- c = line[i];
- if (c >= '0' && c <= '9')
- {
- iq += c;
- }
- else
- {
- name += c;
- }
- }
- cout << "Name : " << name << " IQ : " << iq << endl;
- name = " ";
- iq = " ";
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement