请在 下方输入 要搜索的题目:

编写程序,从键盘输入10本书的名称和定价并存入结构数组中,从中查找定价最高和最低的书的名称和定价,并输出。

编写程序,从键盘输入10本书的名称和定价并存入结构数组中,从中查找定价最高和最低的书的名称和定价,并输出。

发布时间:2025-05-20 22:16:32
推荐参考答案 ( 由 快搜搜题库 官方老师解答 )
联系客服
答案:#include#define NUMBER 10struct book{ char name[10];float price;};int main(){int i,maxl,minl;struct book test[NUMBER];printf(“Input 10 book’s name and price\n”);for(i=0; itest[i].price) minl=i;}printf(“Max Price: %f, %s\n”, test[maxl].price, test[maxl].name);printf(“Min Price: %f, %s\n”, test[minl].price, test[minl].name);return 0;}
专业技术学习
专业技术学习
搜搜题库系统