Изменить '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);
|
int pult=del(list,count);
|
||||||
Sort_Num(list,count);
|
Sort_Num(list,count);
|
||||||
Sort_Sname(list,count);
|
Sort_Sname(list,count);
|
||||||
//Sort_Fname(list,count);
|
|
||||||
print(list,count);
|
print(list,count);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -33,9 +32,10 @@ print(list,count);
|
|||||||
int keep(struct LIS *list){
|
int keep(struct LIS *list){
|
||||||
int count;
|
int count;
|
||||||
for(count=0;fscanf(stdin,"%d %s %s",&list[count].num, list[count].sname, list[count].fname)==3;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;
|
return count;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int del(struct LIS *list,int count){
|
int del(struct LIS *list,int count){
|
||||||
@ -86,12 +86,17 @@ void Sort_Sname(struct LIS *list,int count){//Selection Sort
|
|||||||
|
|
||||||
|
|
||||||
void print(struct LIS *list,int count){
|
void print(struct LIS *list,int count){
|
||||||
printf("Vysledky:\n");
|
if(count!=0){
|
||||||
for(int i=0;i<count;i++){
|
printf("Vysledky:\n");
|
||||||
if(list[i].num!=0){
|
for(int i=0;i<count;i++){
|
||||||
printf("%d %s %s\n",list[i].num, list[i].sname, list[i].fname);
|
if(list[i].num!=0){
|
||||||
|
printf("%d %s %s\n",list[i].num, list[i].sname, list[i].fname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
printf("Nepodarilo nacitat nic");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user