Access - Realizar un programa que solicite una matriz A y una matriz B por teclado y almacene sus valores

 
Vista:
sin imagen de perfil

Realizar un programa que solicite una matriz A y una matriz B por teclado y almacene sus valores

Publicado por anonymous (1 intervención) el 01/12/2016 01:25:31
Hola, he intentado hacer el ejercicio que veis abajo:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Realizar un programa que solicite una matriz A y una matriz B por teclado y almacene sus valores, teniendo en cuenta que las matrices han de ser de 4×4. El programa ha de  presentar el resultado de la suma, resta y traspuestas de las matrices.
 
 
#include<stdio.h>
 
#define N 4
 
 
int A[N][N];
int B[N][N];
int Suma [N][N];
int Resta [N][N];
int TraspuestaA [N][N],traspuestaB[N][N];
 
 
int i,j;
 
int main(void){
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
printf ("Introduzca un número:");
scanf ("%d",&A[i][j]);
}
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
printf ("Introduzca un número:");
scanf ("%d",&B[i][j]);
}
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
 
Suma= A[i][j] + B[i][j];
 
}
}
 
for (i=0;i<N;i++){
for(j=0;j>N;j++){
printf ("%d",Suma[i][j]);
}
Printf("\n");
}
 
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
 
Resta= A[i][j] - B[i][j];
 
}
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
printf ("%d",Resta[i][j]);
}
Printf("\n");
}
 
 
 
 
 
 
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
TraspuestaA[i][j] = A[j][i];
}
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
printf ("%d",TraspuestaA[j][i]);
}
Printf ("\n");
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
TraspuestaB[i][j] = B[j][i];
}
}
 
for (i=0; i<N;i++){
for (j=0;j<N;j++){
printf ("%d",TraspuestaB[j][i]);
}
Printf ("\n");
}
}


Al intentar compilar en la terminal de Linux, me salen los siguientes errores, no sé qué cambios tengo que hacer:


PRACTICA8.c:41:5: error: assignment to expression with array type
Suma= A[i][j] + B[i][j];
^
PRACTICA8.c:50:1: warning: implicit declaration of function ‘Printf’ [-Wimplicit-function-declaration]
Printf("\n");
^
PRACTICA8.c:57:6: error: assignment to expression with array type
Resta= A[i][j] - B[i][j];
^
PRACTICA8.c:90:1: error: ‘TraspuestaB’ undeclared (first use in this function)
TraspuestaB[i][j] = B[j][i];
^
PRACTICA8.c:90:1: note: each undeclared identifier is reported only once for each function it appears in


Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder