Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <windows.h>//для system("pause")
- using namespace std;
- int main()
- {
- ifstream in("f.txt");
- ofstream outDigit("g.txt");
- ofstream outOther("h.txt");
- while (in.peek() != EOF)
- {
- char cur;
- in >> cur;
- if (isdigit(cur))
- outDigit << cur << ' ';
- else
- outOther << cur << ' ';
- }
- in.close();
- outDigit.close();
- outOther.close();
- system("pause");
- }
- /*
- Замечание: файл "f.txt" нужно создать
- пример:
- file "f.txt":
- abadfwa12321312xeawe141z
- file "g.txt"
- 1 2 3 2 1 3 1 2 1 4 1
- file "h.txt"
- a b a d f w a x e a w e z
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement