Anonymous user
Greatest subsequential sum: Difference between revisions
→{{header|D}}
Line 168:
T subsum(T = int)(T[] a) {
}
T[] submax(T = int)(T[] a) {
}
void main() {
array = [-1 , -2 , -3 , -5 , -6 , -2 , -1 , -4 , -4 , -2 , -1] ;
}</pre>▼
writefln("sum of %s = %s", array.submax(), array.submax().subsum()) ;
}
=={{header|Forth}}==
|