Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
62
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. using namespace std;
  4.  
  5.  
  6. int main() {
  7. ifstream file_in;
  8.  
  9. file_in.open("in.txt", ios::in);
  10.  
  11. char a;
  12. int counter = 0;
  13.  
  14. while (!file_in.eof()) {
  15. file_in >> a;
  16. if (a != ' ') {
  17. counter++;
  18. }
  19. }
  20.  
  21. cout << counter;
  22. file_in.close();
  23. system("pause");
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement