Ce afișează programul de mai jos?
#include <iostream>
using namespace std;
struct punct
{
int x, y;
};
struct dreptunghi
{
punct a, b;
};
int main()
{
dreptunghi d[3] = {{{0, 0}, {4, 3}}, {{1, 1}, {3, 6}}, {{2, 0}, {8, 2}}};
int i, k = 0, s, smax = 0;
for (i = 0; i < 3; i++)
{
s = (d[i].b.x - d[i].a.x) * (d[i].b.y - d[i].a.y);
if (s > smax)
{
smax = s;
k = i;
}
}
cout << k << " " << smax;
return 0;
}