
Programa ejecuta pero se cierra.
Publicado por fraancabj1996 (1 intervención) el 03/12/2014 16:55:18
Buenas, tengo un programa en el que lo unico que hace es, mediante tres funciones, Poner en 0 una matriz, cargarla y mostrarla (Mostrar los campos, siempre y cuando no sean 0), hace absolutamente todo, pero cuando termina de mostrarme los campos me aparece el clasico cartel "NombreArchivo.exe" Dejo de funcionar. Alguien me ayuda por favor?
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
#include <stdio.h>
#include <stdlib.h>
/*******************************F U N C I O N E S**************************************/
int CereoMatriz(int Super[][40]);
int CargoMatriz(int Super[][40]);
int MostrarMatriz(int Super[][40]); //MOSTRAR UNICAMENTE LOS ESPACIOS QUE TIENEN ALGO ESCRITO
int CereoVector(int Vect[], int Max);
int main()
{
int Super[120][40];
CereoMatriz(Super);
CargoMatriz(Super);
MostrarMatriz(Super); //MOSTRAR UNICAMENTE LOS ESPACIOS QUE TIENEN ALGO ESCRITO
system("pause");
return 0;
}
/*******************************F U N C I O N E S**************************************/
/**C E R E O M A T R I Z**/
int CereoMatriz(int Super[][40])
{
int i, j;
for(i = 0; i <=120 ; i ++){
for (j = 0; j <=40 ; j ++)
Super[i][j]=0;
}
return 0;
}
/***************************************************************************************/
/**C A R G O M A T R I Z**/
int CargoMatriz(int Super[][40]){
int prod, columna, fila;
printf("\nIngrese su sucursal (Ingrese sucursal 0 para terminar): ");
fflush(stdin);
scanf("%d",&columna);
while(columna!=0){
printf("\nIngrese el numero del producto que quieres: ");
fflush(stdin);
scanf("%d",&fila);
printf("\nOk, ahora ¿Cuantos productos deseas? :");
fflush(stdin);
scanf("%d",&prod);
Super[fila-1][columna-1]+=prod;
printf("\nIngrese su sucursal (Ingrese sucursal 0 para terminar): ");
fflush(stdin);
scanf("%d",&columna);
}
return 0;
}//FIN DE FUNCION
/***************************************************************************************/
/**M O S T R A R M A T R I Z**/ //MOSTRAR UNICAMENTE LOS ESPACIOS QUE TIENEN ALGO ESCRITO
int MostrarMatriz (int Super[][40]){
int i, j;
for ( i = 0 ; i <= 120 ; i++)
for ( j = 0 ; j <= 40 ; j ++){
if (Super[i][j]!=0)
printf("\n\nSucursal %d: %d",j+1, Super[i][j]);
}
return 0;
}//FIN DE FUNCION
Valora esta pregunta


0