From 397ddbe9846311aebb927ebd4745cc7573a723ed Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 9 Apr 2020 09:29:35 +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'du5/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du5/program.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/du5/program.c b/du5/program.c index 7bc5e36..3a11ed4 100644 --- a/du5/program.c +++ b/du5/program.c @@ -32,14 +32,15 @@ int keep(struct LIS *list){ char *array; int stop,count; int num; -int ss; for(int i=0; stop!=EOF; i++){ array=(char*)malloc(100); stop =0; for(int j=0;stop!='\n';j++){ stop=getchar(); if(stop==EOF) break; + if(stop!='\n'){ array[j]=stop; + } } if(stop==EOF) break; sscanf(array,"%d %s %s",&list[i].num,list[i].sname,list[i].fname); @@ -67,29 +68,29 @@ void Sort_Struct(struct LIS *list,int count){//bubble sort :) struct LIS ilusion; for(int i=0;ii;j--){ - if(list[i].num