Posted: Mon Apr 01, 2013 1:07 pm Post subject: Re: Project Euler Problem 1
Cancer Sol @ Mon Apr 01, 2013 12:00 pm wrote:
nullptr @ 4/1/2013, 11:52 am wrote:
Cancer Sol @ Mon Apr 01, 2013 11:42 am wrote:
nullptr @ 4/1/2013, 10:41 am wrote:
Cancer Sol @ Mon Apr 01, 2013 10:00 am wrote:
nullptr @ 4/1/2013, 9:44 am wrote:
Don't check if the total is greater than four million -- check if the current term is greater than four million.
When I changed the while-loop to check fib.two, I got the same answer still.
I just copy-pasted your code and it gives the right answer (with or without that change). Try entering it in again -- maybe you made a typo the first time?
The first time I made the program for it, I had the answer you just got too, but every time I enter it, it's wrong.
Maybe I'm just bad at copying it over to projecteuler.net lol
Are you getting 4613732 as your answer?
Yes, but projecteuler keeps saying it's incorrect
I'll just try a few more times again.
Edit: Nvm, the answer I have is 4285822
That's really weird, it works on codepad: http://codepad.org/vqvwKwvs. It must be something on your computer or compiler.
Sponsor Sponsor
Cancer Sol
Posted: Tue Apr 02, 2013 12:56 am Post subject: Re: Project Euler Problem 1
nullptr @ 4/1/2013, 1:07 pm wrote:
Cancer Sol @ Mon Apr 01, 2013 12:00 pm wrote:
nullptr @ 4/1/2013, 11:52 am wrote:
Cancer Sol @ Mon Apr 01, 2013 11:42 am wrote:
nullptr @ 4/1/2013, 10:41 am wrote:
Cancer Sol @ Mon Apr 01, 2013 10:00 am wrote:
nullptr @ 4/1/2013, 9:44 am wrote:
Don't check if the total is greater than four million -- check if the current term is greater than four million.
When I changed the while-loop to check fib.two, I got the same answer still.
I just copy-pasted your code and it gives the right answer (with or without that change). Try entering it in again -- maybe you made a typo the first time?
The first time I made the program for it, I had the answer you just got too, but every time I enter it, it's wrong.
Maybe I'm just bad at copying it over to projecteuler.net lol
Are you getting 4613732 as your answer?
Yes, but projecteuler keeps saying it's incorrect
I'll just try a few more times again.
Edit: Nvm, the answer I have is 4285822
That's really weird, it works on codepad: http://codepad.org/vqvwKwvs. It must be something on your computer or compiler.
I'll try it on compilr to see if it's fine on it. if it is, it might be my computer (actually, it's my mom's)
Insectoid
Posted: Tue Apr 02, 2013 6:45 am Post subject: RE:Project Euler Problem 1
code:
fib.one=1, fib.two=1, fib.total=0;
There's something missing from this line.
Cancer Sol
Posted: Tue Apr 02, 2013 10:48 am Post subject: Re: RE:Project Euler Problem 1
Insectoid @ 4/2/2013, 6:45 am wrote:
code:
fib.one=1, fib.two=1, fib.total=0;
There's something missing from this line.
Am I supposed to assign fib.sum its value already? I'm not sure what I'm missing still.
So do I do it like:
Posted: Tue Apr 02, 2013 5:13 pm Post subject: RE:Project Euler Problem 1
Woops, never mind. Thought you were adding to it instead of assigning it directly.
Cancer Sol
Posted: Thu Apr 04, 2013 3:45 pm Post subject: Re: Project Euler Problem 1
Idk, I give up. Too hard lol xD
I'll do these questions another time.
The only one I could do is only the first question, so sad
Panphobia
Posted: Thu Apr 04, 2013 4:58 pm Post subject: Re: Project Euler Problem 1
Ok I edited your code from when you first posted a while ago, and since you might be having problems with your compiler, try this, this gave me the correct answer 100%
Posted: Fri Apr 05, 2013 1:17 am Post subject: Re: Project Euler Problem 1
The answer is 4613732 right? Because when I entered it in the website, it still said it's wrong.
Sponsor Sponsor
nullptr
Posted: Fri Apr 05, 2013 7:21 am Post subject: Re: Project Euler Problem 1
Cancer Sol @ Fri Apr 05, 2013 1:17 am wrote:
The answer is 4613732 right? Because when I entered it in the website, it still said it's wrong.
Yeah, it is 4613732. It even says so on the problem page once you've solved the problem, so I can't think what's giving you trouble.
Panphobia
Posted: Fri Apr 05, 2013 8:30 am Post subject: RE:Project Euler Problem 1
Cancer maybe you have entered the security code wrong? Have you ever thought of that?
Cancer Sol
Posted: Fri Apr 05, 2013 4:17 pm Post subject: Re: RE:Project Euler Problem 1
Panphobia @ 4/5/2013, 8:30 am wrote:
Cancer maybe you have entered the security code wrong? Have you ever thought of that?
Well here's what the second page says after I enter the answer:
Quote:
Sorry, but the answer you gave appears to be incorrect.
I don't think that's the wrong confirmation code :/
Panphobia
Posted: Fri Apr 05, 2013 4:43 pm Post subject: RE:Project Euler Problem 1
definitely is the right answer
MOD Edit: Let's draw the line at helping with the code. We don't need to see the actual value.
Cancer Sol
Posted: Fri Apr 05, 2013 4:51 pm Post subject: Re: RE:Project Euler Problem 1
Oh wait actually... I've been entering it for the wrong question, my bad xD
Thanks! I was entering it for question 3 the whole time, LOL.
That was why it didn't work the whole time...