From 9cc672665574587ac99ca5ce29dfd0638d365b14 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 16 Apr 2020 09:40:28 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'du6/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du6/program.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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){ +