From 404689b7956082f043af577520176757b097d8c4 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 16 Apr 2020 21:02:42 +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 | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/du6/program.c b/du6/program.c index 78f6610..b7e3924 100644 --- a/du6/program.c +++ b/du6/program.c @@ -8,6 +8,8 @@ char fname[100]; int num; }; +int spase=0; + char keep(struct LIS*,int); void sort(struct LIS*,int); void print(struct LIS*,int,int); @@ -34,10 +36,11 @@ else{ char keep(struct LIS* list,int places){ int count=0; -char names[100]; for(;fgets(list[count].fname,100,stdin);){ if(list[count].fname[0]=='\n'){ + spase++; list[count].num=-1; + } if(list[count].fname[0]!='\n'){ list[count].num=0; @@ -72,7 +75,7 @@ void print(struct LIS *list,int count,int places){ if(count>0){ if(places>0){ printf("Prijati studenti:\n"); - for(int i=0;i0){ fputs(list[i].fname,stdout); } @@ -80,7 +83,7 @@ void print(struct LIS *list,int count,int places){ } if(count-places>0){ printf("Neprijati studenti:\n"); - for(int i=0;i