Version:0.9 StartHTML:0000000105 EndHTML:0000001994 StartFragment:0000000152 EndFragment:0000001960
/******************************************************/
/*************** Isidro Pastor Jorda ******************/
/******************************************************/
/****************** Telematica ************************/
/******************************************************/
/************* Practica 7 Ejercicio 2 *****************/
/******************************************************/
#include <iostream.h>
#include <stdlib.h>
#include <string>
int main()
{
string frase;
int pos;
cout << " Eliminacion de los espacios de una frase \n";
cout << " Introduce la frase: ";
getline(cin, frase);
while ( pos != -1)
{
pos = frase.find(' ');
if ( pos != -1 )
{
frase.erase(pos,1);
}
}
cout << " La frase sin espacios es: \n";
cout << frase << endl;
system("PAUSE");
return 0;
}