So i'm trying to make a recursive program for a class im taking,but so far i can't seem to get it to run i've tried for 2 days now and just can't seem to get around the error's i'm getting. If you guy's and gal's could please take a look and see if you could help it would be greatly appreciated.Thank You

Code:
```#define n 5
struct elemento
{
};
typedef elemento TipoDato;
int Pesos[n],OabjetivoAalcanzar;

void Inicializa()
{
Pesos[0]=7; Pesos=[1]=5; Pesos[2]=4; Pesos[3]=4; Pesos[4]=1;
OabjetivoAalcanzar=10;
}
Void MochilaExacta(int OabjetivoAalcanzar,int i,int *Solucion)
{
/*Finishes with success if siObjetivo=0 or if sio Objetivo<0 or i=n */
if((OabjetivoAalcanzar<=0)||(i==n))
if(OabjetivoAalcanzar==0)
*Solucion=1;
else;/*dont do anything because Objetivo<0 or i=n */
else
{
do
{
{
case 1:/*Inclusion*/
printf("%d",Pesos[i]); /*Its been included and has a solution*/
break;
case 2:/*Exclusion*/
/*Even if Encontrado is true,there is nothing left to do*/
}
}
}
}
void MochilaExacta_N_R(int OabjetivoAalcanzar)
{
int i,Solucion;
Pila *P;
lemento e,el;
i=0;
Solucion=0;
VaciaP(&P);
AnadeP(&P,e);/*Assigns the initial value to the pile P considering Pesos[0]*/
while(!EsVaciaP(P))
{
e=PrimeroP(P);
BorrarP(&P);
if(Solucion)/*If you already have a solution then write it*/
{
printf("%d\n",Pesos[i]);/*Only written if something is included*/
i--;
}
else
{
if(OabjetivoAalcanzar==0)
Solucion=1;/*A solution is always obtainable*/
i--;/*the i hasnt been tested,You go back on the recursive*/
}
else/*There is no decision consider the state of the candidate*/
{
case Ninguno: /*1st it includes an advance in the recursive*/
OabjetivoAalcanzar-=Pesos[i];
i++;
break;
case Incluido: /*Now the advance is excluded*/
/*i-- is backed up;on option else of what*/
OabjetivoAalcanzar+=Pesos[i];
/*since it was removed it has to be added*/
i++;
break;
case Excluido:
/*the current election didnt give any results ending recursivity*/
i--;
}
}
}
void main (void)
{
int Solucion;
Inicializa();
MochilaExacta(OabjetivoAalcanzar,0,&Solucion);
if(Solucion)
printf("Solution given for Object=%d\n",OabjetivoAalcanzar);
Solucion=0;
OabjetivoAalcanzar=10;
MochilaExacta_N_R(OabjetivoAalcanzar);
if(Solucion)
printf("A Solution was found");
}```

2. What exactly is the problem ? What is it you're trying to do ? You can't just post code and expect us to know what's supposed to be going on...

3. Thats the thing i dont know what the problem is,i keep getting these 5 errors and i have no clue why,i mean i dont see the problem,It is a recursive program as i stated in the beginning.

Errors im getting is:

Code:
```enum Estados {Ninguno, Incluido, Excluido}
struct elemento```
Too many types in declaration

Code:
```struct elemento
{
};```
Declaration missing ;

Code:
`typedef elemento TipoDato;`
, expected

Code:
`Pesos[0]=7; Pesos=[1]=5; Pesos[2]=4; Pesos[3]=4; Pesos[4]=1;`
Expression Syntax

Code:
`Void MochilaExacta(int OabjetivoAalcanzar,int i,int *Solucion)`
Declaration Syntax Error

4. missing ;
Code:
`enum Estados {Ninguno, Incluido, Excluido};`
void is case sensetiv
Pesos=[1] - remove =

don't put too much on one line - it is hard for you to see typing erros in the long lines

5. Originally Posted by vart
missing ;
Code:
`enum Estados {Ninguno, Incluido, Excluido};`
void is case sensetiv
Pesos=[1] - remove =

don't put too much on one line - it is hard for you to see typing erros in the long lines
Thank you lol fixing those 2 errors gave me a whopping 9 now lol i suck