Advertisement
qradmanq

dz 3.4

Oct 7th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int a = 0;
  10. string line;
  11. setlocale(LC_ALL, "rus");
  12. ifstream fout("C:\\testing\\test.txt");
  13. if (fout)
  14. {
  15. while (true)
  16. if (!isdigit(char(fout.peek())))
  17. fout.ignore();
  18. else {
  19. fout >> a;
  20. cout << a << ' ';
  21. }
  22.  
  23.  
  24. }
  25. else
  26. cout << "Нет на диске";
  27. fout.close();
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement