comp.lang.ada
 help / color / mirror / Atom feed
* Ada95 Help 2D arrays
@ 2012-04-20 11:46 Will
  2012-04-20 16:27 ` Niklas Holsti
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Will @ 2012-04-20 11:46 UTC (permalink / raw)


I really need help with the problem below... any ideas?  I was thinking about passing each row and column into their own arrays or something but I am not even sure how to go about doing that.  Please send me your ideas if you can help.  Thanks again,

willmann817


Many people across America participate in Superbowl pools. Your pool is run a little differently from most. Instead of buying individual squares from a grid, you purchase a row and a column. After painstaking research, you have assigned an integer score to each square representing the probability of that event occurring. You want to buy the row and column with the maximum combined score, calculated by adding all the individual scores in that row and column.

For example, consider the following grid:

   10 20 30 40

   20 30 20 20

   30 20 10 10

   40 20 10 40


Your best option is to choose the first row and the first column, giving you a combined score of 190.


Write a function Best_Combined_Score(Grid) that takes an Int_Matrix and returns the maximum combined score, as described above. You can assume that the grid is square, and that it contains only positive integers.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-20 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 11:46 Ada95 Help 2D arrays Will
2012-04-20 16:27 ` Niklas Holsti
2012-04-20 16:55 ` Will
2012-04-20 17:33 ` Will
2012-04-20 18:12   ` Niklas Holsti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox