Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a lil problem for u all to solve
Author Message
ZiNgA BuRgA
Smart Alternative

Posts: 17,022.2988
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1294
Offline
Post: #23
RE: a lil problem for u all to solve
Lol, trial and error, not bad :P

Of course, a simple program would've always worked:

C Code
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
int main()
{
	float a, b, c;
	for(a = 1; a<=200; a++)
		for(b=1; b<=34; b++)
			for(c=1; c<=10; c++)
				if(a+b+c == 100 && 0.5*a+3*b+10*c == 100)
				{
					printf("Answer is a=%d, b=%d, c=%d", a, b, c);
				}
	return 0;
}


Was trying to find a mathematical solution.
I'm sure it works, just I'm not bothered.


Good job cR@Zy!NgLi$h - you smart cookie (hai clever confectionary) :D
So u_c_taker, managed to skip doing your homework?

(This post was last modified: 26/01/2008 10:21 PM by ZiNgA BuRgA.)
26/01/2008 10:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: a lil problem for u all to solve - ZiNgA BuRgA - 26/01/2008 10:17 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)

 Quick Theme: