Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <algorithm>
- using namespace std;
- int main () {
- setlocale(LC_ALL, "es_ES");
- string linea; string tmp;
- ofstream salida; salida.open ("salida.txt");
- ifstream archivo; archivo.open ("entrada.txt");
- while (getline(archivo, linea)) {
- while(linea.size()) {
- unique_copy (linea.begin(), linea.end(), back_inserter(tmp), [](char c1, char c2){ return c1 == ' ' && c2 == ' '; }); break; } }
- salida << tmp << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement