#include <iostream>
#include <climits>
using namespace std;
struct Test {
float book_price;
int book_tax;
};
int find_max(Test arr[], int len) {
int mx = INT_MIN;
for (int i = 0; i < len; i++) {
int tmp = arr[i].book_price + arr[i].book_tax;
mx = max(mx, tmp);
}
return mx;
}
int main()
{
Test arr[] = {
{ 4, 6 },
{ 1, 7 },
{ 11, 5 },
{ 8, 6 },
{ 2, 3 },
{ 7, 5 }
};
int result = find_max(arr, sizeof arr / sizeof arr[0]);
cout << result;
return 0;
}
/*
run:
16
*/