Open WaymanAndres opened 3 years ago
using namespace std; / run this program using the console pauser or add your own getch, system("pause") or input loop / void reemplazar(string& frase, string buscar, string rempl) {
int pos = frase.find(buscar);
while(pos!=-1){
frase.replace(pos,buscar.size(),rempl);
pos=frase.find(buscar,pos+rempl.size());
}
} int main(int argc, char** argv) { system("cls"); string frase,p1,p2;
getline(cin,frase);
cin>>p1>>p2;
reemplazar(frase,p1,p2);
cout<<frase<<endl;
system("pause");
return 0;
}
include
include
include
include
include
include
include
include
include
using namespace std; int menu(){ int x; system("cls"); cout<<"Bienvenido"<<endl; cout<<"1. Agregar Palabra"<<endl; cout<<"2. Ver Palabras"<<endl; cout<<"3. Buscar Palabra"<<endl; cout<<"4. Modificar Palabra"<<endl; cout<<"6. salir"<<endl; cin>>x; return x; }
void agregar(ofstream &es){ system("cls"); string pal; string tra; string sig, pal1; es.open("Palabras.txt", ios::out | ios::app); if(es.fail()){ cout<<"no se pudo abrir"; exit(1); }
}
void verRegistros(ifstream &Lec){ system("cls"); string pal; string tra; string sig;
}
void buscarPersona(ifstream &Lec){ system("cls"); Lec.open("Palabras.txt", ios::in); string pal, tra, sig, codigoaux; bool encontrado = false; cout<<"Digite el nombre: "; cin>>codigoaux; Lec>>pal; while(!Lec.eof()&&!encontrado){ Lec>>tra; Lec>>sig;
}
void modificar(ifstream &Lec){ system("cls"); string pal; string tra; string sig;
}
int main(){ ofstream Esc; ifstream Lec; int op; do{
}