From 4ed18d0addb9058b4a0acd6e1966c261f1086e7c Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 16 Apr 2020 13:51:03 +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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/du6/program.c b/du6/program.c index a768694..2fac10f 100644 --- a/du6/program.c +++ b/du6/program.c @@ -25,7 +25,6 @@ if(k!=1 || places<0){ else{ int count=keep(list,places); sort(list,count); - printf("%d",count); print(list,count,places); } return 0; @@ -53,6 +52,7 @@ char names[100]; } } } + count--; return count; } @@ -79,8 +79,8 @@ void sort(struct LIS* list,int count){ void print(struct LIS *list,int count,int places){ if(count>0){ if(places>0){ - puts("Prijati studenti:"); - for(int i=0;i<=count;i++){ + printf("Prijati studenti:\n"); + for(int i=1;i<=count;i++){ if(list[i].num==2){ printf("%s\n",list[i].fname); } @@ -91,7 +91,7 @@ void print(struct LIS *list,int count,int places){ } if(count-places>0){ printf("Neprijati studenti:\n"); - for(int i=0;i<=count;i++){ + for(int i=1;i<=count;i++){ if(list[i].num==3){ printf("%s\n",list[i].fname); }