Gentoo Archives: gentoo-user

From: James <wireless@×××××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: program to solve assignment problem?
Date: Tue, 03 Nov 2009 15:23:30
Message-Id: loom.20091103T153816-453@post.gmane.org
In Reply to: [gentoo-user] program to solve assignment problem? by Erik
1 Erik <esigra <at> gmail.com> writes:
2
3
4 > Is there some simple little program to solve assignment problems?
5 > Suppose that someone bought k meat (160), m fish (30) and n milk (15)
6 > for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
7 > 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
8 > condition could be that he bought at most 6 items; k + m + n <= 6. That
9 > would eliminate solutions like k = 4, m = 0, n = 4.)
10
11 First of all, if you post something to the list like this,
12 put OT for off topic. Second of all, if you make *ANY* attempt
13 to solve this on your own, you *might* get some programming
14 tips, depending on which language you use. Personally, I'd just
15 use C.
16
17
18 Most important of all, the solution is trivial. Look at your last
19 stated 'boundary condition', and get your head out of programming
20 and think logically........
21
22
23
24
25 goodluck,
26 James