Dev - C++ - (AYUDA) problema de ejecucion

 
Vista:
sin imagen de perfil

(AYUDA) problema de ejecucion

Publicado por Federico Godoy (1 intervención) el 23/05/2015 02:40:21
Hola! soy nuevo en el foro, me paso por acá para pedir su colaboracion en este programa que me da problemas en la ejecución, si me pudieran ayudar les agradecería mucho
acá el error:
20h24d5
acá el código:
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#include<stdio.h>
#include<conio.h>
#define N 1230
#define L 4
#define I 10
struct Zona
{
int acum_imp[L];
int cont_mov[L];
};
 
 
void carga_imp(int imp1[I])
{
int i;
for(i=0;i<=I-1;i++)
{
    printf("\ningrese importe comenzando por el primer tipo de infraccion\n");
	scanf("%d",&imp1[i]);
	fflush(stdin);
}
return;
}
 
void inicializa(Zona A1[L])
{
int i,j;
for(i=0;i<=L-1;i++)
    {
    for(j=0;j<=L-1;i++)
        {
        A1[i].acum_imp[j]=0;
        A1[i].cont_mov[j]=0;
        }
    }
return;
}
void carga(Zona A2[L],int imp2[I])
{
int i,zone,tip_mov,tip_imp;
for(i=1;i<=N;i++)
{
printf("\nIngrese zona(1,2,3o4)\n");
scanf("%d",&zone);
fflush(stdin);
switch (zone)
{
    case 1:
        printf("\nIngrese tipo de movil(1,2,3o4)\n");
        scanf("d",&tip_mov);
        fflush(stdin);
        printf("\nIngrese tipo de importe(1,2,3,4,5,6,7,8,9o10)\n");
        scanf("d",&tip_imp);
        fflush(stdin);
        A2[zone-1].acum_imp[tip_mov-1]+=imp2[tip_imp-1];
        A2[zone-1].cont_mov[tip_mov-1]++;
        break;
    case 2:
        printf("\nIngrese tipo de movil(1,2,3o4)\n");
        scanf("d",&tip_mov);
        fflush(stdin);
        printf("\nIngrese tipo de importe(1,2,3,4,5,6,7,8,9o10)\n");
        scanf("d",&tip_imp);
        fflush(stdin);
        A2[zone-1].acum_imp[tip_mov-1]+=imp2[tip_imp-1];
        A2[zone-1].cont_mov[tip_mov-1]++;
        break;
    case 3:
        printf("\nIngrese tipo de movil(1,2,3o4)\n");
        scanf("d",&tip_mov);
        fflush(stdin);
        printf("\nIngrese tipo de importe(1,2,3,4,5,6,7,8,9o10)\n");
        scanf("d",&tip_imp);
        fflush(stdin);
        A2[zone-1].acum_imp[tip_mov-1]+=imp2[tip_imp-1];
        A2[zone-1].cont_mov[tip_mov-1]++;
        break;
    case 4:
        printf("\nIngrese tipo de movil(1,2,3o4)\n");
        scanf("d",&tip_mov);
        fflush(stdin);
        printf("\nIngrese tipo de importe(1,2,3,4,5,6,7,8,9o10)\n");
        scanf("d",&tip_imp);
        fflush(stdin);
        A2[zone-1].acum_imp[tip_mov-1]+=imp2[tip_imp-1];
        A2[zone-1].cont_mov[tip_mov-1]++;
        break;
    }
}
return;
}
 
 
void motos_tip2(Zona A3[L])
{
int i;
for(i=0;i<L-1;i++)
{
printf("\nEl dinero recaudado por la zona %d",i+1," es: %d",A3[i].acum_imp[0]);
}
return;
}
 
 
void menor_inf(Zona A4[L])
{
    int i,j,men,num;
men=1000000;
for(i=0;i<L-1;i++)
{
  for(j=0;j<L-1;i++)
            if(A4[i].cont_mov[j]<men)
             {
                    men=A4[i].cont_mov[j];
                    num=j+1;
             }
 
    printf("\nEl tipo de movil que registra mayor numero de infracciones de la zona %d",i+1,"es movil tipo; %d\n",num);
}
return;
}
void tot_infr_xtipo(Zona A5[L])
{
    int tipo,i,sum;
    printf("Por favor ingrese tipo de movil para conocer el total de infracciones del mismo\n");
    scanf("%d",&tipo);
    fflush(stdin);
    sum=0;
    for(i=0;i<L-1;i++)
      {
            sum+=A5[i].cont_mov[tipo-1];
        }
    printf("\nLa cantidad de infracciones del tipo de movil %d",tipo,"es: %d",sum);
return;
}
void muestra(Zona A6[L])
{
    int i,j,acum;
    acum=0;
    for(i=0;i<L-1;i++)
    {
        for(j=0;i<L-1;i++)
        {
        acum+=A6[i].acum_imp[j];
        }
    }
printf("\nEl importe total recaudado por la Municipalidad en concepto de multas de transito es: %d\n",acum);
return;
}
main()     //algoritmo principal//
{
Zona A[L];
int imp[I];
carga_imp(imp);
inicializa(A);
carga(A,imp);
motos_tip2(A);
menor_inf(A);
tot_infr_xtipo(A);
muestra(A);
getchar();
getchar();
}
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