Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 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)) {
  13. while(linea.size()) {
  14. unique_copy (linea.begin(), linea.end(), back_inserter(tmp), [](char c1, char c2){ return c1 == ' ' && c2 == ' '; }); break; } }
  15. salida << tmp << endl;
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement