Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. int main()
  4. {
  5.     char a;
  6.     ifstream file ("txt.txt");
  7.     ofstream file1 ("txt1.txt");
  8.     file1 << "[b]";
  9.     while (file >> a)
  10.     {  
  11.         if (a == ' ')   {file1 << ' ';}
  12.         else if (a != '\n') {file1 << a;}
  13.         else if (a == '\n') {file1 << "[b]" << '\n' << "[b]";}
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement