ayuda no me imprime los resultados
Publicado por David Rodriguez (3 intervenciones) el 23/05/2019 01:24:14
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
#include<iostream>
#include<sstream>
#include<string>
#include<conio.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main()
{
string matriz [100][100];
int matriz2 [100][100], matriz3 [100][4],filas, columnas;
int filas2=0, columnas2=0;
int suma=0, promedio=0, acomulador=0, mayor=0, menor=999999999;
cout<<"Digite el numero de participantes: ";
cin>>filas;
cout<<"Digite el numero de vueltas: ";
cin>>columnas;
filas2=(filas-1);
columnas2=(columnas);
//Almacenar
for(int i=0; i<filas; i++)
{
for(int j=0; j<columnas+1; j++)
{
if(j==0)
{
cout<<"Digite nombre del ciclista: ";
cin>>matriz [i][j];
}
else
{
cout<<"Digite cuantos munutos tardo en completar el cicuito: ";
cin>>matriz [i][j];
}
}
}
//Llenar
for(int i=0; i<filas2; i++)
{
for(int j=0; j<columnas2; j++)
{
(istringstream (matriz [i+1][j+1]) >> matriz2 [i][j]);
}
}
//Operaciones
for(int i=0; i<filas; i++)
{
for(int j=0; j<columnas; j++)
{
suma+= matriz2 [i][j];
if(mayor<matriz2 [i][j])
{
mayor << matriz2 [i][j];
}
if(menor>matriz2 [i][j])
{
menor << matriz2 [i][j];
}
for(int i=0; i<filas2; i++)
{
for(int j=0; j<4; j++)
{
matriz3 [i][1] << suma/columnas2;
matriz3 [i][2] << menor;
matriz3 [i][3] << mayor;
matriz3 [i][4] << suma;
}
}
}
}
//Mostrar
for(int i=0; i<filas; i++)
{
cout<<"Ciclista: " ,matriz [i][1];
cout<<"\n";
cout<<"Promedio de vueltas: %d " ,matriz3 [i][1];
cout<<"\n";
cout<<"Mejor vuelta", matriz3 [i][2];
cout<<"\n";
cout<<"Peor vuelta", matriz3 [i][3];
cout<<"\n";
cout<<"Total minutos", matriz3 [i][4];
cout<<"\n";
for(int j=0; j<columnas; j++)
{
cout<<"\n";
cout<<"Tiempo de todas las vueltas : " ,matriz2 [i][j];
}
}
system("pause");
system("cls");
return main();
// fin unidad 3
Valora esta pregunta


0