The program should accept 5 records of books and displays them on the screen
#include <iostream>
struct book {
string name;
int pages;
int isbn;
};
int main() {
for (int i = 0; i < 5; i++) {
book b;
std::cin >> b.name >> b.pages >> b.isbn;
std::cout << i + 1 << std::endl;
std::cout << "name: " << b.name << std::endl;
std::cout << "pages: " << b.pages << std::endl;
std::cout << "isbn: " << b.isbn << std::endl;
}
return 0;
}
Comments
Leave a comment