Mathematical programming

Dear C++ users.. I am new using C++ and would like to know:
How could I solve the following (simplified version of my) problem

Max X*Y-X-Y
subject to the restriction
X+ Y = 10
?

Which "packages" or commands should I use?

Thank you for your attention.

JeanJacques

if (x+y=10)
{
max=X*Y-X-Y;
}
In more general terms, I have a problem of numerical optimization: a non-linear function (to be maximized) subject to several linear or non-linear restrictions.
C++ is an imperative language, not a declarative one. You have to learn how to restate your declarative requirements into sequences of instructions.

Generally speaking, you have to learn programming.

Or, try to find some application (or perhaps a programming language) that can process declarative requirements.
Topic archived. No new replies allowed.