Forum: C Apr 7th, 2007 |
| Replies: 10 Views: 5,886 Actually, according to this very enlightening read (http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx), you're all wrong...
(sorry, I couldn't help it either) :mrgreen: |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 9,013 I don't think you even need Top3 (and you're using it uninitialized, which is bad). Top will be updated as you call pop, so you could probably just do:
while(Top)
pop(Top); |
Forum: C Apr 1st, 2007 |
| Replies: 10 Views: 9,013 I tried running it and after a few small touchups (no logical changes though) it seems that you're off to a good start. Here's how it went:
$ ./a.out
this is a line
enil a si siht As you can... |
Forum: C Mar 31st, 2007 |
| Replies: 10 Views: 1,307 You'll need a bignum library. I've seen mention of the Gnu Multiple Precision (http://gmplib.org/) library before, so you might give that a shot. |
Forum: C Mar 26th, 2007 |
| Replies: 4 Views: 2,264 Instead of giving a book answer, I figured I'd help you help yourself: did you try it? You can learn a lot just from experimenting and seeing if something works or not. |
Forum: C Mar 8th, 2007 |
| Replies: 21 Views: 5,797 Actually, my brain wasn't really functioning either, now that I look at it. The no-brainer algorithm we all jumped on works so long as the coins are multiples of each other, or have a fairly high... |
Forum: C Mar 8th, 2007 |
| Replies: 21 Views: 5,797 To summarize the algorithm provided by Lazarus, you just add as many of the biggest coin you can. Then repeat for the next biggest until you have the amount. |