Problema 1.
Inicio
tabla [5] [5]int
r,cint
suma=0.0int
for(r=0 to 5 step r++)
{
for(c=0 to 5 step c++)
{
print,"tabla [ ",r,",",c," ]= "
read tabla[r] [c]
}
}
for(r=0 to 5 step r++)
{
suma=0
for(c=0 to 5 step c++)
{
suma=suma+tabla[r] [c]
Print ,tabla[r][c],"\t"
}
print,suma,
}
Fin
Problema 2.
Inicio
tabla [5] [5]int
r,cint
suma=0.0int
for(r=0 to 5 step r++)
{
for(c=0 to 5 step c++)
{
print,"tabla [ ",r,",",c," ]= "
read tabla[r] [c]
}
}
for(r=0 to 5 step r++)
{
suma=0
for(c=0 to 5 step c++)
{
suma=suma+tabla[r] [c]
Print ,tabla[r][c],"\t"
}
print,suma,
}
Fin
Problema 3.
Inicio
tabla [4] [5]int
r, cint
suma=0.0int
for(c=0 to 5 step c++)
{
suma=0.0
for(r=0 to 4 step r++)
{
print "tabla [ ", r,",", c,”]=“
readtabla[r] [c]
suma=suma + tabla[r] [c]
}
Print"la suma de columna ", c," es: ", suma
}
Fin
Problema 4.
Iniciomatriz[6][4], I, J, suma=0 int
for (I=0to5 step I+1){for (J=0 to4 step J+1){print,"matriz[",I,", ",J,"] = "read matriz[I][J]}}for (I=0 to 4 step I+1){suma=0;for (J=0 to5 step J+1){suma=suma+matriz[J][I]}matriz[5][I]=suma;}for (I=0 to 6 step I+1){for (J=0; to 4 stepJ+1){print, matriz[I][J],"\t"}print.endl}
Final.
for (I=0to5 step I+1){for (J=0 to4 step J+1){print,"matriz[",I,", ",J,"] = "read matriz[I][J]}}for (I=0 to 4 step I+1){suma=0;for (J=0 to5 step J+1){suma=suma+matriz[J][I]}matriz[5][I]=suma;}for (I=0 to 6 step I+1){for (J=0; to 4 stepJ+1){print, matriz[I][J],"\t"}print.endl}
Final.
Problema 5.
Inicio
matriz[7][8], r, c, suma=0, mayor1=0, posc=0, mayor2=0, posr=0 int
randomize
print,"Matriz Original",,
for (r=0 to6; step r+1)
{
suma=0;
for (c=0 to 7 step c+1)
{
matriz [r][c]=random (10)
suma=suma+matriz[r][c]
print,matriz[r][c],"\t"
}
matriz[r][7]=suma
print,
}
for (c=0 to 7 stepc+1)
{
suma=0;
for (r=0 to 6 step r+1)
{
suma=suma+matriz[r][c]
}
matriz[6][c]=suma;
}
matriz[6][7]=0;
for (c=0 to 7 step c+1)
{
if (matriz[6][c]>mayor1)
{
mayor1=matriz[6][c]
posc=c
}
}
for (r=0 to 6 step r+1)
{
if (matriz[r][7]>mayor2)
{
mayor2=matriz[r][7]
posr=r;
}
}
print,"\nMatriz con la suma de renglones y columnas",,
for (r=0; r<7; r=r+1)
{
for (c=0 to 8 step c+1)
{
print,matriz[r][c],"\t"
}
print,
}
print,"\n";
print,"La suma mayor del renglon ",posr," es = ",mayor2,
read,"\n"
print,"La suma mayor de la columnas ",posc," es = ",mayor1,
Final
Problema 6.
Inicio
A[5][5], B[5][5] int
I,J int
random()
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
A[I][J]=random(1000)+1
B[J][I]=A[I][J]
}
}
Print "Matriz Original"
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
Print A[I][J] , "\t "
}
Print "\n"
}
Print "Matriz Transpuesta"
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
Print B[I][J] , "\t"
}
Print "\n"
}
I,J int
random()
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
A[I][J]=random(1000)+1
B[J][I]=A[I][J]
}
}
Print "Matriz Original"
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
Print A[I][J] , "\t "
}
Print "\n"
}
Print "Matriz Transpuesta"
for(I=0 to 5 step I++)
{
for(J=0 to 5 step J++)
{
Print B[I][J] , "\t"
}
Print "\n"
}
Final.
Problema 8.
inicio
a[10][10]int
maxint
minint
i,jint
randomize()
for(i=0 to 10 step i++)
{
for(j=0 to 10 step j++)
{
a[i][j]=random(1000)+1
}
}
Print"Matriz de 10 X 10"
print” “
for(i=0 to 10 step i++)
{
for(j=0 to 10 step j++)
{
Printa[i][j],""
}
print” “
}
for(i=0 to 10 step i++)
{
for(j=0 to 10 step j++)
{
if(a[i][j]>max)
max=a[i][j]
}
}
print "El numero máximo de la matriz es: ",max
print” “
for(i=0 to 10 step i++)
{
for(j=0 to 10 step j++)
{
if(a[i][j]<min)
min=a[i][j]
}
}
print “El numero mínimo de la matriz es: ",min
Fin







No hay comentarios:
Publicar un comentario