Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. void process2(const char* filein,const char* fileout) {
  2. string res,sentence,word;
  3. fin.open(filein);
  4. if (!fin) { cout << "Ошибка открытия файла в process"; exit(0); }
  5. rab.open(fileout,ios_base::app);
  6. if (!rab) { cout << "Ошибка открытия файла в process"; exit(0); }
  7. rab << "\n\n2 задание\n\n";
  8. while (!fin.eof()) {
  9. fin >> word;
  10. sentence.append(word + ' ');
  11. if (word[word.size() - 1] == '?') {
  12. res.append(sentence + ' ');
  13. sentence.clear();
  14. }
  15. else if (word[word.size() - 1] == '.') {
  16. sentence.clear();
  17. }
  18. }
  19. rab << res;
  20. fin.close();
  21. rab.close();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement