struct Books{
char title[50];
char author[50];
char subject[100];
int book_id;
};
int main(){
Books books1;
Books books2;
strcpy(books1.title,"c++");
strcpy(books1.author,"run");
strcpy(books1.subject,"编程语言");
books1.book_id=123;
strcpy( books2.title, "CSS 教程");
strcpy( books2.author, "Runoob");
strcpy( books2.subject, "前端技术");
books2.book_id = 12346;
// 输出 Book1 信息
cout << "第一本书标题 : " << books1.title <<endl;
cout << "第一本书作者 : " << books1.author <<endl;
cout << "第一本书类目 : " << books1.subject <<endl;
cout << "第一本书 ID : " << books1.book_id <<endl;
// 输出 Book2 信息
cout << "第二本书标题 : " << books2.title <<endl;
cout << "第二本书作者 : " << books2.author <<endl;
cout << "第二本书类目 : " << books2.subject <<endl;
cout << "第二本书 ID : " << books2.book_id <<endl;
return 0;
}