{ Type agrege de stockage des informations } { relatives a une position en deux dimensions } structure position2D   reel x <- 0.0   reel y <- 0.0 fin structure { Type agrege de stockage des informations } { relatives a un triangle en deux dimensions } structure triangle2D   position2D p0   position2D p1   position2D p2 fin structure { Programme principal } action principale() triangle2D t reel surface afficherln("SVP, x & y du sommet 1?") t.p0.x <- saisir() t.p0.y <- saisir() afficherln("SVP, x & y du sommet 2?") t.p1.x <- saisir() t.p1.y <- saisir() afficherln("SVP, x & y du sommet 3?") t.p2.x <- saisir() t.p2.y <- saisir() surface <- (t.p0.x-t.p1.x)*(t.p0.y+t.p1.y)+ (t.p1.x-t.p2.x)*(t.p1.y+t.p2.y)+ (t.p2.x-t.p0.x)*(t.p2.y+t.p0.y) surface <- abs(surface)/2.0 afficherln("Surface: ",surface) fin action