Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main () {
  7. setlocale(LC_ALL, "es_ES");
  8. string linea; string tmp;
  9. ofstream salida; salida.open ("salida.txt");
  10. ifstream archivo; archivo.open ("entrada.txt");
  11.  
  12. while(!getline(archivo, linea).eof()) {
  13. linea += 'n';
  14. unique_copy (linea.begin(), linea.end(), back_inserter(tmp), [](char c1, char c2){ return c1 == ' ' && c2 == ' '; }); }
  15.  
  16. salida << tmp;
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement