I have test all the samples input/output that I found in this forum and they work ok.

please, if someone knows I would appreciate very much that tells me some possible tricky case or something like that.

thanks!!!

Here is my code:

[c]

#include <stdio.h>

int card[21];

int cases=0;

int evaluate(int n, int x){

int i,j;

int people[50];

int n2,temp=0;

int index=0;

n2=n;

for (i=1;i<=n;i++)

people

*=1;*

while(n2>x){

index++;

if (index>20){

printf("Selection #%d\n",cases);

for (i=1;i<=n;i++)

if (people

while(n2>x){

index++;

if (index>20){

printf("Selection #%d\n",cases);

for (i=1;i<=n;i++)

if (people

*==1) printf("%d ",i);*

printf("\n\n");

return 0;

}

for (i=1,temp=1;i<=n;i++){

if (temp==card[index]){

if (peopleprintf("\n\n");

return 0;

}

for (i=1,temp=1;i<=n;i++){

if (temp==card[index]){

if (people

*==1){*

peoplepeople

*=0;*

n2--;

if (n2==x) goto a;

}

else if (peoplen2--;

if (n2==x) goto a;

}

else if (people

*==0)*

while(i<=n){

i++;

if (peoplewhile(i<=n){

i++;

if (people

*==1){*

peoplepeople

*=0;*

n2--;

if (n2==x) goto a;

break;

}

}

temp=1;

}

else{

if (peoplen2--;

if (n2==x) goto a;

break;

}

}

temp=1;

}

else{

if (people

*==1) temp++;*

}

}

}

a:

printf("Selection #%d\n",cases);

for (i=1;i<=n;i++)

if (people}

}

}

a:

printf("Selection #%d\n",cases);

for (i=1;i<=n;i++)

if (people

*==1) printf("%d ",i);*

printf("\n\n");

}

int main()

{

int n; /*people participating in the lottery*/

int x; /*how many lucky positions*/

int i;

while(scanf("%d %d",&n,&x)!=EOF){

cases++;

for (i=1;i<=20;i++)

scanf("%d",&cardprintf("\n\n");

}

int main()

{

int n; /*people participating in the lottery*/

int x; /*how many lucky positions*/

int i;

while(scanf("%d %d",&n,&x)!=EOF){

cases++;

for (i=1;i<=20;i++)

scanf("%d",&card

*);*

evaluate(n,x);

}

return 0;

}[/c]

I know it's an ugly code ...but I am a beginner...evaluate(n,x);

}

return 0;

}[/c]

I know it's an ugly code ...but I am a beginner...