Hi guys! Thanks for the tips, I did it quite alright with your suggestions!
I ended up reading the numbers and coping them in a bi-dimensional array. There I looped summing, storing only (sum/10) in...
Type: Posts; User: Doriän
Hi guys! Thanks for the tips, I did it quite alright with your suggestions!
I ended up reading the numbers and coping them in a bi-dimensional array. There I looped summing, storing only (sum/10) in...
Thanks!
I see your point here - and to be honest, I already thought of doing something like that, but left the idea when I realized I had no idea how to switch lines...now I'll think a bit about it...
Indeed.
So, as probably someone understood from my previous post, I'm trying to work my way out of the easiest problems listed in projecteuler.net, in an attempt to improve my coding skills and my...
I didn't know this. Thanks!
Done. It is indeed several times faster (I had already tried this method some time ago, in another exercise with prime numbers, but that time it didn't work - looks like I'll have to check that one...
SUCCESS! Thanks guys, problem solved!
here's the final code, perhaps I could still learn something from errors I overlooked...
/*The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find...
Oh, all right, I got your point now. Is more a "standard" issue, then, am I right? Perhaps I could use EXIT_SUCCESS and EXIT_FAILURE, as declared in stdlib.h? (meh, I believe they're declared...
You know what, guys? I think I64d made the trick. I changed the printf in the loop and left unchanged the one at the end of the program. I looped up to MAX/2 (just to try it out) and the first one...
Thanks!
I'm using Eclipse's CDT...
i don't get your point. My func returns 0 if is a prime, doesn't it? isn't 0 a success return value?
yeah, I was skipping even numbers in the function, now I implemented a condition in the...
...
nombreEntree = nombreEntree * 10 + (carac - '0');
Is this (and the others " - '0'"s) because getchar stores an ASCII?
Hi guys! I'm getting some troubles trying to find the sum of all primes below 1 million. I think I created a fairly good program (or at least one that should get the job done!), but apparently I'm...