# Simle align/3 project

There are three lists of integers, as shown below.

list(1,[2,3,4,10,22,11,17]).

list(2,[1,2,3,4,10,22,11,11,10,24]).

list(3,[2,3,4,5,10,23,10,22,11,17]).

The aim is to find the common trio of consecutive integers in

the lists above, which has maximum sum. Obviously in each

listing the triad may be in a different location. at our

example the trio sought shown below.

[2,3,4,10,22,11,17]).

| location 4)

[1,2,3,4,10,22,11,11,10,24]).

| (location 5)

[2,3,4,5,10,23,10,22,11,17]).

| (location 7)

Implement a predicate allign / 3 which in the first argument

returns the positions where start the triplets we seek in any

list, the second argument is the triad, and the third the

the sum.

?- allign(Pos, Triple, Sum).

Pos = [4, 5, 7]

Triple = [10, 22, 11]

Sum = 43

Yes ([url removed, login to view] cpu)

Compétences : Delphi, Microsoft Access, Prolog, Visual Basic, Visual Basic pour les apps

Concernant l'employeur :
( 0 commentaires ) Greece

N° du projet : #12683814