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