I’ve looked at your question and this is what I could come up with, I think it is the solution because the algorithm is correct but check if the syntax are correct because I ran them on p5.js editor and had to edit them so they will run on Processing IDE. Next time you should type your question and not post pictures as Chrissir pointed out. Good luck with your project work.
int cities ={{20,30,40},{2,4,5},{7,3,5},{6,11,17}}
int distance ={ }
function setup(){
createCanvas(400,400);
background(100)
for ( i = 0; i< cities.length; i++) {
for (j = 0; j < cities[i].length-1; j++) {
distance = dist((cities[i][j]),(cities[i][j+1]),(cities[i+1][j]),(cities[i+1][j+1]));
}
}
}