test5

#include
#include
struct book{
    char book_name[31];
    double cost; 
    
};

int main(void){
    int n;
    scanf("%d",&n);
    struct book b[9];   
    int max_index=0,min_index=0;
    for(int i=0;ib[i].cost){
            min_index=i;
        }
    }

    printf("%.2f, %s\n",b[max_index].cost,b[max_index].book_name);
    printf("%.2f, %s",b[min_index].cost,b[min_index].book_name);    
    
    
    
    return 0;
}

你可能感兴趣的:(test5)