Изменить 'du5/program.c'
This commit is contained in:
parent
6edddf930a
commit
518f00f2ed
@ -25,7 +25,6 @@ int count=keep(list);
|
||||
int pult=del(list,count);
|
||||
Sort_Num(list,count);
|
||||
Sort_Sname(list,count);
|
||||
//Sort_Fname(list,count);
|
||||
print(list,count);
|
||||
return 0;
|
||||
}
|
||||
@ -33,9 +32,10 @@ print(list,count);
|
||||
int keep(struct LIS *list){
|
||||
int count;
|
||||
for(count=0;fscanf(stdin,"%d %s %s",&list[count].num, list[count].sname, list[count].fname)==3;count++){
|
||||
for(int i=0;list[count].fname[i]!='\0';i++);
|
||||
// for(int i=0;list[count].fname[i]!='\0';i++);
|
||||
}
|
||||
return count;
|
||||
|
||||
}
|
||||
|
||||
int del(struct LIS *list,int count){
|
||||
@ -86,6 +86,7 @@ void Sort_Sname(struct LIS *list,int count){//Selection Sort
|
||||
|
||||
|
||||
void print(struct LIS *list,int count){
|
||||
if(count!=0){
|
||||
printf("Vysledky:\n");
|
||||
for(int i=0;i<count;i++){
|
||||
if(list[i].num!=0){
|
||||
@ -93,6 +94,10 @@ void print(struct LIS *list,int count){
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
printf("Nepodarilo nacitat nic");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user