Date: 2013-05-13 05:09 am (UTC)
Мне понравился вопрос, предложенный в своё время Joel Spolsky (код на JavaScript):

Using the function

function accumulate(combiner, nullValue, l)
{
	if (l.length == 0)
		return nullValue;
	var first = l.shift();
	return combiner(first, accumulate(combiner, nullValue, l));
}

Implement sumOfSquares, which calculates the sum of squares of a list, for example

sumOfSquares([1,2,3,4,5])

should evaluate to 55.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

June 2025

S M T W T F S
123 4 5 6 7
8 910 11 12 13 14
15 16 17 1819 20 21
22 23 24 25 26 27 28
29 30     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 6th, 2025 12:47 pm
Powered by Dreamwidth Studios