Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. ifstream fin("f.txt");
  2. ofstream fout("g.txt");
  3. while(fin.peek() != EOF){
  4. f = 0;
  5. while(fin.peek() != EOF && fin.peek() != '\n'){
  6. cc = fin.get();
  7. if((ccc == ' ' || ccc == '\t') && cc != ' ' && cc != '\t'){
  8. n++;
  9. f = 1;
  10. }
  11. ccc = cc;
  12. }
  13. if(fin.peek() == EOF){
  14. if(f == 1)k++;
  15. }
  16. if(fin.peek() != EOF){
  17. fin.get();
  18. if(f == 1)k++;
  19. }
  20. }
  21. fout << k << endl << n;
  22. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement