Advertisement
Pafnytiu

Подсчёт символов в файле

Jan 23rd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. #include<string>
  4. using namespace std;
  5. int main()
  6. {
  7. int k = 0;
  8. ifstream in("input.txt");
  9. ofstream out("output.txt");
  10. string::size_type size;
  11. for (size = 0; !in.eof(); size++)
  12. {
  13. in.get();
  14. k++;
  15. }
  16. out << k-1;
  17. in.close();
  18. out.close();
  19. system("pause");
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement