You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
338 B
C++
21 lines
338 B
C++
#include <iostream>
|
|
using std::cout, std::endl;
|
|
|
|
struct Book {
|
|
char title[100];
|
|
int pages;
|
|
float price;
|
|
};
|
|
|
|
bool isExpensive(const Book& b) {
|
|
if (b.price > 1000) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int main() {
|
|
Book b = {"One Hundred Years of Solitude", 456, 1200};
|
|
cout << isExpensive(b) << endl;
|
|
}
|