//顺序表图书信息
#include<bits/stdc++.h>
using namespace std;
#define Max 100
//定义
typedef struct book_data
{
string book_number;
string book_name;
float book_price;
} book_data;
int main()
{
book_data list[Max];
int n,m,t;
cin>>n;
for(int i=1;i<=n;i++){
cin>>list[i].book_number;
cin>>list[i].book_name;
cin>>list[i].book_price;
}
cin>>m;
for(int j=1;j<=m;j++){
cin>>t;
if(t<=n&&t>0)
{
cout<<list[t].book_number<<" "<<list[t].book_name<<" ";
printf("%.2lf",list[t].book_price);
cout<<endl;
}
else
cout<<"Sorry,the book on the best position doesn't exist!"<<endl;
}
}
//注意换行
顺序表图书信息
最新推荐文章于 2024-08-17 23:59:05 发布