david12 de Agosto del 2003
PreguntaNECESITO AYUDA CON ESTE PROGRAMA
#include <stdio.h>
# include <string.h>
#define nemesis 3
typedef struct empleado {
char nombre[30];
char direccion[40];
int sueldo;
};
struct empleado empleado[nemesis];
int main()
{
printf (" Umbrella Corporationnnn");
printf (" Registro de empleadosnn");
int num_emp;
char aux;
for( num_emp=0; num_emp<nemesis; num_emp++ )
{
printf( "nEmpleado número %i:nn", num_emp+1 );
printf( "Teclea el nombren: " );
gets(empleado[num_emp].nombre);
printf( "Teclea la direccionn: " );
gets(empleado[num_emp].direccion);
printf( "Teclea el sueldon: " );
scanf( "%i", &empleado[num_emp].sueldo );
while(getchar()!='n');
}
if (strcmp ( struct empleado.nombre[num_emp], struct empleado.nombre[num_emp+1])> 0)
{
strcpy (aux, struct empleado.nombre[num_emp]);
strcpy (struct empleado.nombre[num_emp],empleado.nombre[num_emp+1]);
strcpy (struct empleado.nombre[num_emp+1],aux);
}
for( num_emp=0; num_emp < nemesis ; num_emp++)
{
printf( "n Empleado(a): %sn ",struct empleado[num_emp].nombre );
printf( "Direccion: %sn ", struct empleado[num_emp].direccion );
printf( "El sueldo es de: %in ",struct empleado[num_emp].sueldo );
}
return(0);
return(0);
}
ME MARCA 3 ERRORES POR FAVOR AYUDEME URGENTEMENTE, SI ESPOSIBLE LA RESPUESTA ANTES DEL MIERCOLES, ES MI DERECHO A EXAMEN
#include <stdio.h>
# include <string.h>
#define nemesis 3
typedef struct empleado {
char nombre[30];
char direccion[40];
int sueldo;
};
struct empleado empleado[nemesis];
int main()
{
printf (" Umbrella Corporationnnn");
printf (" Registro de empleadosnn");
int num_emp;
char aux;
for( num_emp=0; num_emp<nemesis; num_emp++ )
{
printf( "nEmpleado número %i:nn", num_emp+1 );
printf( "Teclea el nombren: " );
gets(empleado[num_emp].nombre);
printf( "Teclea la direccionn: " );
gets(empleado[num_emp].direccion);
printf( "Teclea el sueldon: " );
scanf( "%i", &empleado[num_emp].sueldo );
while(getchar()!='n');
}
if (strcmp ( struct empleado.nombre[num_emp], struct empleado.nombre[num_emp+1])> 0)
{
strcpy (aux, struct empleado.nombre[num_emp]);
strcpy (struct empleado.nombre[num_emp],empleado.nombre[num_emp+1]);
strcpy (struct empleado.nombre[num_emp+1],aux);
}
for( num_emp=0; num_emp < nemesis ; num_emp++)
{
printf( "n Empleado(a): %sn ",struct empleado[num_emp].nombre );
printf( "Direccion: %sn ", struct empleado[num_emp].direccion );
printf( "El sueldo es de: %in ",struct empleado[num_emp].sueldo );
}
return(0);
return(0);
}
ME MARCA 3 ERRORES POR FAVOR AYUDEME URGENTEMENTE, SI ESPOSIBLE LA RESPUESTA ANTES DEL MIERCOLES, ES MI DERECHO A EXAMEN
