Изменить 'du6/program.c'
This commit is contained in:
parent
0764976b56
commit
cc19e9fd6b
@ -11,6 +11,7 @@ int num;
|
||||
char keep(struct LIS*,int);
|
||||
void sort(struct LIS*,int);
|
||||
void print(struct LIS*,int,int);
|
||||
void AAAAA(struct LIS*, int,int);
|
||||
|
||||
int main(){
|
||||
|
||||
@ -24,6 +25,7 @@ if(k!=1 || places<0){
|
||||
else{
|
||||
int count=keep(list,places);
|
||||
sort(list,count);
|
||||
AAAAA(list,count,places);
|
||||
print(list,count,places);
|
||||
}
|
||||
return 0;
|
||||
@ -69,19 +71,16 @@ int mini;
|
||||
void print(struct LIS *list,int count,int places){
|
||||
if(count>0){
|
||||
if(places>0){
|
||||
int i=0;
|
||||
int k=0;
|
||||
printf("Prijati studenti:\n");
|
||||
for(int i=0;k!=places;i++){
|
||||
if(list[i].num==0){
|
||||
for(int i=0;i<count+count;i++){
|
||||
if(list[i].num>0){
|
||||
fputs(list[i].fname,stdout);
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count-places>0){
|
||||
printf("Neprijati studenti:\n");
|
||||
for(int i=(count-places)+1;i<30;i++){
|
||||
for(int i=0;i<count+count;i++){
|
||||
if(list[i].num==0){
|
||||
fputs(list[i].fname,stdout);
|
||||
}
|
||||
@ -89,6 +88,18 @@ void print(struct LIS *list,int count,int places){
|
||||
}
|
||||
}
|
||||
}
|
||||
void AAAAA(struct LIS* list, int count,int places){
|
||||
int k=1;
|
||||
for(int i=0;i<100;i++){
|
||||
if(k!=places+1){
|
||||
if(list[i].num==0){
|
||||
list[i].num=k;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%d",k);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -101,4 +112,3 @@ void print(struct LIS *list,int count,int places){
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user