Programación Que Calcula La Suma De Cada Una De Las Columnas De Uno Tabla De Números Reales.
//GRUPO K1
//05 DE OCTUBRE DEL 2012
//El siguiente programa calcula la suma de cada una de lascolumnas de uno tabla de números reales.
VAR
A:ARROY [1..3,1..3] OF INTEGER;
R:ARROY[1..3] OF INTEGER;
I,K:INTEGER;
BEGIN
FOR I:=1 TO3 DO
FOR K:=1 TO 3 DO
A[I,K]:=STRTOINT[STRING(END)].CELLS[K,I];
FOR I:=1 TO 3 DO
R[I]:=0;
FOR I:=1 TO 3 DO
FOR K:=1 TO 3 DOR[I]:=R[I]+A[K,I];
FOR I:= 1 TO 3 DO
STYRINGRID I CELLS [I,4]:=INTTOSTR(R[I]);
END
//CARLOS EDUARDO DE DIOS DE LA CRUZ
//GRUPO K1
//05DE OCTUBRE DEL 2012
//El siguiente programa calcula la suma de cada uno de los renglones de una matriz.
VAR
A:ARRAY[1..3,1..3] OFINTEGER
C:ARRAY[1..3] OF INTEGER
I,K:INTEGER
BEGIN
FOR I:=1 TO 3 DO
FOR K:=1 TO 3 DO
A[I,K]:=STRTO INT(STRINGGRID 1.CELLS[K,I]);FOR I:=1 TO 3 DO
C[I]:=0;
FOR I:=1 TO 3 DO
STRINGGRID1.CELLS[4,I]:=INTTOSTR(C[I]);
END
//CARLOS EDUARDO DE DIOS DE LA CRUZ
//GRUPOK1
//05 OCTUBRE DEL 2012
//El siguiente programa suma todos los elementos de la diagonal principal y de la diagonal secundaria.
VARA:ARRAY[1..3,1..3] OF INTEGER;
DP,DS:INTEGER;
I,K:INTEGER
BEGIN
FOR I:=1 TO 3 DO
FOR K:=1 TO 3 DOA[I,K]:=STRTOINT(STRINGGRID1.CELLS[K,I]);
DP:=0;
FOR I:=1 TO 3 DO
DP:=DP+A[1,I);
DS:=DS+A[3+1-I,1];
EDIT1.TEXT:=INTTOSTR(DP);
EDIT2.TEXT:=INTTOSTR(DS);
END
Regístrate para leer el documento completo.