[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>my son of basterd boss says if I can't figure out how

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 1

File: 1488571951412.jpg (8KB, 250x242px) Image search: [Google]
1488571951412.jpg
8KB, 250x242px
>my son of basterd boss says if I can't figure out how to sum all the primes below two million he's going to send me back to india

help please
>>
Save yours and his time, pack your bags and get back on the banana boat.
>>
ebin le maymay redditor XD
>>
>>59739134
>sum all the primes below two million
I've fallen behind with the memes trend. What's this? I saw it spammed all day today.
>>
SEE YA IN THE SHITTING STREETS PAJEET
>>
>>59739134
it's simple

int sum =0;
for(x=1;x<2000000;x++){
int c= 0;
for(y=1;y<x;y++){
if(x%y==0)
c++;
if(c >3)
break;
}
if(c<=2)
sum+x;

c=0
}
>>
>>59739134

int sum = 0;
boolean prime = true;
for(int i = 0; i < 2000000; i++){
for(int j = 2; j < i; j++){
if(i % j == 0)
prime = false;
}
if(prime)
sum += i;
if(!prime)
prime = true;
}
//because I don't want to write a method so I
//can return it, deal with the print.
System.out.print(sum);

>>
>>59739134
back in the good old days i had a classmate who constantly asked me for my codesnippets because he was too lazy
and being the nice person that i was i gave them to him
and i always told him try it out and try to understand it before giving it to the teacher

till one day i had enough
he was behind on the last and most important assignment of the year that makes out around 50% of the mark
he hasn't done anything and so he asks me for my thing
he says he'll rewrite it so that it doesn't look like mine anymore
i at this point had enough so i gave him my first draft that i made back in the beginning when we got the assignment
it looked like it works
but the algorithms were all faulty and a bunch of other things that delivered dummy/wrong values
he took it

the once the day to present it came i had a working thing got a 1.3 because my ui design was godawful
but that's besides the point

his turn was nice
he was cocky all day since he has heard how well my program worked
and then with a giant grin he pressed start and an array went out of bounce and the program crashed
he stood there for 5 or so min to try to "fix" this little error
in the end he failed the class

the morale of the story is
don't be a fucking cretin
>>
>>59739637
br00tal d00d

>also nice thread OP
>>
J language is nice
+/ p: i.2*10^6 
>>
import Data.List
import Data.Numbers.Primes

primesum n = sum $ takewhile (<n) primes

main = print (primesum 2000000)
>>
>>59740092
Is that a language ?
>>
>>59740121
>> Uses currying
>> Guy who needed help is a pajeet

Thats racist anon!
>>
>>59740127
Yes google, J language and you will find it.
>>
Total[Map[Prime, Range[PrimePi[2000000]]]]
>>
>>59739134
there's at least 4 memes in this post
>>
>>59743987
Prove it.
Thread posts: 17
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.