Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. int main()
  2. {
  3.     SetConsoleCP(1251);
  4.  
  5.     freopen("input.txt","r",stdin);
  6.     freopen("output.txt","w",stdout);
  7.  
  8.     char c;
  9.     string line;
  10.  
  11.     while(scanf("%c", &c)==1)
  12.     {
  13.         if(c=='\n' || c == EOF)
  14.         {
  15.             cout << line;
  16.             line.clear();
  17.         }
  18.         line+=c;
  19.     }
  20.  
  21.     fclose (stdout);
  22.     fclose (stdin);
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement