diff --git a/du6/program.c b/du6/program.c index 2135ced..5b82bfc 100644 --- a/du6/program.c +++ b/du6/program.c @@ -40,7 +40,7 @@ char fn[100]; for(;stop!=EOF;count++,num--){ stop=fscanf(stdin,"%s %s",list[count].sname,list[count].fname); } - count=-2; + count--; return count; } @@ -66,10 +66,14 @@ void sort(struct LIS* list,int count){ } void print(struct LIS *list,int count,int places){ int j=0; + int nado=places; + if(places>count){ + nado=count; + } if(places>0){ puts("Prijati studenti:"); - for(;j0) @@ -82,3 +86,4 @@ void print(struct LIS *list,int count,int places){ +