#include #include #include using namespace std;

struct Book { string name; string author; string date; };

bool cmp(const Book &a, const Book &b) { return a.date < b.date; }

int main() { int n; cin >> n; Book *books = new Book[n]; for(int i = 0; i < n; i++) { cin >> books[i].name >> books[i].author >> books[i].date; } sort(books, books+n, cmp); for(int i = 0; i < n; i++) { cout << books[i].name << " " << books[i].author << " " << books[i].date << endl; } delete[] books; return 0;

标签: 社会


原文地址: https://cveoy.top/t/topic/fDBR 著作权归作者所有。请勿转载和采集!