#include #include #include using namespace std; const int MAX=118; typedef char tcad[30]; typedef struct tele{ tcad nombre; tcad simbolo; int protones; int neutrones; int electrones; tcad grupo; }; typedef struct tnodo *telemento; typedef struct tnodo{ tele dato; telemento sig; //puentero }; typedef struct ttabla{ //tlista telemento inicio; int cont; }; void crear_tabla(ttabla &t) { t.inicio=NULL; t.cont=0; } void crear_elemento(telemento &e) //e puntero { e=new tnodo; if(e!=NULL){ cout<<"\Ingrese nombre: "; fflush(stdin); gets(e->dato.nombre); cout<<"Ingrese simbolo: "; gets(e->dato.simbolo); cout<<"ingrese protones: "; cin>>e->dato.protones; cout<<"Ingrese neutrones: "; cin>>e->dato.neutrones; cout<<"Ingrese electrones: "; cin>>e->dato.electrones; cout<<"Ingrese grupo: "; fflush(stdin); gets(e->dato.grupo); e->sig=NULL; } else cout<<"no se dispone de memoria"<sig=t.inicio; t.inicio=nuevo; } t.cont++; } } void mostrar_tabla(ttabla t) { telemento i; for(i=t.inicio;i!=NULL;i=i->sig) { cout<<"\nnombre: "<dato.nombre<dato.simbolo<dato.neutrones<dato.electrones<dato.protones<dato.grupo<sig) if(strcmp(grupo,i->dato.grupo)==0) { cout<<"\nnombre: "<dato.nombre<dato.simbolo<dato.grupo<dato.nombre)==0) encontrado=true; else i=i->sig; if(encontrado) cout<<"el elemento "<dato.protones+i->dato.neutrones<