Prog sum of integers --- Introduction ---

This modules gathers interactive programming exercises, variable and configurable, on the subject of computing a list of integers. The software can ask you to produce an algorithm to make a partial or total sum of the list, according to various formulas. It will then compile your submitted code and test it on randomly generated lists for the validity of the code. New comers may start by testing the most standard case.

Sum of absolute values

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of affine formula

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Alternate sum

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Count of digits

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Count of a digit

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Conditional coeff by divisibility

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Conditional coeff by inequality

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Conditional coeff by parity

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


. Simple count

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of first digit

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of last digit

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of a digit

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of digits

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of distances with a constant

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Indexed sum of distances

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of gcd I

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of gcd II

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of gcd III

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Indexed sum I

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Indexed sum II

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum min-max with a constant

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Index sum min-max I

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Indexed sum min-max II

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


. Simple sum

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


Sum of signs

a function which takes a list of integers

0,...,,...,-1

(), and returns , . and returns .


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the following list of integers:

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:

The most recent version


Cette page n'est pas dans son apparence habituelle parce que WIMS n'a pas pu reconnaître votre navigateur web.
Afin de tester le navigateur que vous utilisez, veuillez taper le mot wims ici : puis appuyez sur ``Entrer''.

Veuillez noter que les pages WIMS sont générées interactivement; elles ne sont pas des fichiers HTML ordinaires. Elles doivent être utilisées interactivement EN LIGNE. Il est inutile pour vous de les ramasser par un programme robot.