int main() { vector<int> numbers; vector<string> strings; string temp; int tempint; setlocale(LC_ALL, "rus"); string str; ifstream ifstr("text.txt"); while (ifstr >> temp) { if (isdigit(temp[0])) { ifstr.clear(); ifstr.unget(); ifstr >> tempint; numbers.push_back(tempint); } else { strings.push_back(temp); } } ifstr.close(); for (int i : numbers) { cout << i << " "; } cout << endl; for (string i : strings) { cout << i << " "; } cout << endl; system("pause"); return 0; }