Изменить 'du6/program.c'

This commit is contained in:
Pavlo Tverdyi 2020-04-16 09:40:28 +00:00
parent a0eb4665a5
commit 9cc6726655

View File

@ -40,7 +40,7 @@ char fn[100];
for(;stop!=EOF;count++,num--){ for(;stop!=EOF;count++,num--){
stop=fscanf(stdin,"%s %s",list[count].sname,list[count].fname); stop=fscanf(stdin,"%s %s",list[count].sname,list[count].fname);
} }
count=-2; count--;
return count; return count;
} }
@ -66,10 +66,14 @@ void sort(struct LIS* list,int count){
} }
void print(struct LIS *list,int count,int places){ void print(struct LIS *list,int count,int places){
int j=0; int j=0;
int nado=places;
if(places>count){
nado=count;
}
if(places>0){ if(places>0){
puts("Prijati studenti:"); puts("Prijati studenti:");
for(;j<places;j++){ for(;j<nado;j++){
printf("%s %s\n",list[j].sname,list[j].fname); printf("%s %s1\n",list[j].sname,list[j].fname);
} }
} }
if(count-places>0) if(count-places>0)
@ -82,3 +86,4 @@ void print(struct LIS *list,int count,int places){