Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Vector Distancia constante
program VectorDistancia; const max = 5; var vector : array[1..max] of integer; i, cont, res1, res2 : integer; respuesta : boolean; begin vector[1] := -2; vector[2] := -1; vector[3] := 0; vector[4] := 1; vector[5] := -2; cont := 2; for i:=1 to max-2 do begin res1 := vector[i] - vector[i+1]; res1 := abs(res1); res2 := vector[cont] - vector[cont+1]; res2 := abs(res2); writeln('res1 -> ', i, ' ',res1,' res2 -> ', i+1, ' ',res2); if (res1 = res2) then respuesta := TRUE else begin respuesta := FALSE; break; end; cont:= cont + 1 ; end; if respuesta = TRUE then writeln('La distancia es constante') else writeln('La distancia NO es constante'); end.
run
|
edit
|
history
|
help
0
rf cdx
Promo1
Mostrar un arreglo ( array )
Naloga 3: 4.7.2016
zadacha3
test22
6
Kim
Area of a Triangle
yh