Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 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 >> noskipws >> a)                            
  10.     {                                                      
  11.         if (a == ' ')   {file1 << ' ';}
  12.         else if (a == '\n') {file1 << "[/b]\n[b]";}
  13.         else {file1 << a;}
  14.     }
  15.     file1 << "[/b]";
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement