/*****************************************
* Let's pick an arbitrary number, *
* because >>1 didn't specify which one! *
* I think I'll choose ``1". *
*****************************************/
int main(void) { return 0; }
Name:
Anonymous2012-10-02 19:08
long long primes[] ={ 2, 3, 5, 7, 11, 13, 17, 23}; // TODO: ADD THE REST OF THE PRIMES HERE
long long num = 8; // number of primes goes here
int main()
{
int input = 0;
printf("number:");
scanf("%d",&input);
for(int i = 0; i < num; i++)
{
if(primes[i] < input)
{
printf("%d",primes[i]);
}
}
return 0;
}
This is easy. I'll hint, then you give me a biscuit.
Make an array for primes for N/2,
make and integer, i, with a limit max of N,
Continuously increment i, and test that it is not divisible by 2 and it is not 2,
if not, increase i again and repeat loop from start,
save i to an array of i's,
Test in a loop that prime[i] is not divisible by prime[test],
if not, increase i again and repeat loop from start,
print i
Then print, "I am done teach. give me a biscuit."
Name:
Anonymous2012-10-02 20:56
>>14 god damn you people suck. why the fuck do i have to take comp sci if im a business major???
So the JEWS can get your tuition and use it to let niggers and illegal, unwashed mexicans in for free.
Name:
Anonymous2012-10-02 21:01
>>14
Now you should really quit while you can. I am >>15-kun, And that statement is like say,
"Why do I have to sign things, when all I want to do is own the fucking place?"
Business major is programming revenue, dipshit. If you cannot get simple algorithms, you will never make it past the next month of any you start.
Get a math theory book, and get started, or I will smash personally
Name:
Anonymous2012-10-02 21:03
>>17
i don't care about computers or math. my family already owns a company i just want the degree :)
Name:
Anonymous2012-10-02 21:05
>>18
you are so retarded, that you can't write such a simple algorithm? kill yourself please.
OP, for the sakes the rest of your life, either kill yourself, or go to the art department. You do not deserve the degree with that mentality. Or even your computer.
Name:
Anonymous2012-10-02 21:24
>>23
i'm not a fucking faggot art student and im not about to hang out with faggots who obsesses over the size of a cock in some abstract bullshit and thinks it means the stuggle of man to fight the cops or or some equally retarded
and BA is way worse than a BS
Name:
Anonymous2012-10-02 21:27
Sure, it's easy, but is it Abelson easy?
Name:
Anonymous2012-10-02 21:30
>>24
No wonder you can't program, you can barely even speak English. Might be best to drop out and stick with manual labor.
Name:
Anonymous2012-10-02 21:33
>>24
I love it when you fall in your trap. See you in art class. I would love to see your Dark Oppressive art.
I'm printing the hard-coded array [2 3 5 7 ...], but there must be some `mathematical' way of doing it, i just can't remember how.
Name:
Leah Culver2012-10-02 22:12
That seems to me like something people would remember if they had used it before. I’d never had to print prime numbers before and I kept thinking that there was some way to do it mathematically, but I couldn’t remember how. I hope it’s not as important to know the best solution as it is to know a better solution exists.
Name:
Anonymous2012-10-02 22:56
Enjoy fucking Richard Stallman's hairy man boobs while the sweet Leah is rubbing my dick between her white, soft, aryan, valkyriesque mammaries.
>>7 is far from efficient but it works. You didn't need ``infinite'' streams for your homework, but it's interesting and fun. The code is from SICP and I eeven took the pain to include the needed macros and redefinitions to make it works in any R5RS Scheme. As is, it will give you the nth prime:
>>66
Who would suck a pædo? Oh, that's right, the children you rape.
Name:
Anonymous2012-10-04 14:34
>>67
Who would kill a pædo? Oh, that's right, a lot of people.
Name:
Anonymous2012-10-04 14:35
>>67
You are trying my patience. Just go back to tittysluts or wherever the fuck you come from and leave the Touhou out of this, or I'll see to it that you regret it. I have many friends in #4chan IRC.
>>73
He's at a frat party right now and won't be available for a few days. Perhaps we should hurry and get it done before he gets back, or he might give us wedgies!
Trigger Warning: Windows format PE Console 4.0
include 'win32a.inc'
entry main
section '.text' code data readable writeable executable
sieve:
cmp dword[esp+8],1
jle .ret
push esi
push edi
mov esi,[esp+0xC] ;ESI = buffer
mov edi,[esp+0x10] ;size
push ebx
lea ecx,[edi-2] ;ECX = size - 2
mov ebx,2 ;EBX = p
push edi
push edi
fnstcw [esp]
fnstcw [esp+2]
wait
or byte[esp+1],0xC
fldcw [esp]
fild dword[esp+4]
fsqrt
fistp dword[esp+4]
fldcw [esp+2]
pop edi
pop edi ;EDI = upto
push edi
push ecx
mov word[esi],0
mov al,1
lea edi,[esi+2]
rep stosb
pop ecx
pop edi
add esi,ebx
db 0x66,0x90
.loop:
cmp byte[esi],0
jnz .Prime
.cond:
inc ebx
inc esi
dec ecx
cmp ebx,edi
jl .loop
jmp @f
.Prime:
mov eax,ebx
imul eax,eax
sub eax,ebx
.SetToNonPrime:
mov byte[esi+eax],0
add eax,ebx
cmp eax,ecx
jl .SetToNonPrime
jmp .cond
@@:
pop ebx
pop edi
pop esi
.ret:
retn 8
main:
push getnum_printstr
call [printf]
push esp
push getnum_scanstr
call [scanf]
add esp,8
inc dword[esp]
push edi
push dword[esp+4]
call [malloc]
mov edi,eax
push eax
call sieve
push ebx
push esi
mov ebx,[esp+0xC]
mov esi,2
sub ebx,esi
push esi
push numstr
@@:
cmp byte[esi+edi],0
je .NotPrime
call [printf]
.NotPrime:
inc esi
mov [esp+4],esi
dec ebx
jnz @b
pop eax
pop eax
pop esi
pop ebx
push edi
call [free]
pop edi
call [getch]
pop edi
pop ecx
ret
align 4
data import
library crt,'MSVCRT.DLL'
import crt,getch,'_getch',free,'free',malloc,'malloc',printf,'printf',scanf,'scanf'
end data
numstr db '%u',9,0
getnum_printstr db 'Find up to which number? ',0
getnum_scanstr db '%u',0
Name:
Anonymous2013-05-30 5:07
>>86
LELLLLLLLELLELELELLELELEELELLELELELELELLELEL
HES SOOOOOOO ED/G/Y XDDDDDDDDDDDDDDDDD
I WANNA SUCK HE BI/G/ /G/IANT ED/G/Y /G/ONADSSS XDDDDDDDDDDDD
I WISH I CUD BE AS ED/G/Y AS HIM
SO DREAM LELLLLELLELELELLELELELELELLELEELELELELEL
>E/G/IN
>>9 The most widely spoken Semitic languages today are ARABIC[1] (206 million native speakers),[2] Amharic (27 million),[3][4] Hebrew (about 7 million),[5] Tigrinya (6.7 million),[6] and Aramaic (about 2.2 million).
>>98
I don't know how he came up with it, but to me it'll always be from this guro that I saw on /b/ in, like, 2005, where this girl had her skin removed and was raped and tortured while the guy was taunting her, then he used a waffle iron to eat the fat. It scarred me for life, and the phrase still disturbs me.
>>100
So that's the reason you don't like `my' term!
I `came up' with it because I saw someone on /jp/ using it. It is accurate enough, as perfect breasts are precisely that, nugget-sized fat balls. I know "nugget-sized" is unscientific and mostly subjective, so here's a sample: http://i.imgur.com/AfuAZ6c.png
That size or something a tad smaller is perfect.
Also, I'm sorry to hear about your story, though. I only saw real gore in the old /b/.