Advertisement
inukyuho

3.4

Dec 14th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7. ofstream fout("TEXT.txt");
  8. fout << "к1е2к3";
  9. fout.close();
  10. setlocale(LC_ALL, "rus");
  11. char buff;
  12. ifstream fin("TEXT.txt");
  13.  
  14. if (!fin.is_open())
  15. cout << "Файл не может быть открыт!\n";
  16. {
  17. while (fin.get(buff)) {
  18. if (buff >= '0' && buff <= '9') {
  19. cout << buff << endl;
  20. }
  21. }
  22.  
  23. }
  24. system("pause");
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement