Necesito Pasar de C++ a Pascal
Publicado por Miguel Leal (1 intervención) el 09/06/2014 05:54:51
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
#include <iostream>
#include <stdlib.h>
#define DPTOS 3
using namespace std;
int main() {
int votos,votantes,abstencioDPTOS,total,i,j;
int maximo,max_indice;
system("CLS");
for(i=0;i<DPTOS;i++) {
for(j=0;j<=6;j++) {
if(j == 0) {
cout<<"Votos en blanco en el Dpto " <<i<<": ";
cin>> votos,i,j;
// Almacena los datos leidos en la matriz
}
else {
cout<<"Votos del partido P"<<j<<" en el Dpto "<<i<<": ";
cin>>votos,i,j;
// Almacena los datos leidos en la matriz
}
}
}
cout<<endl;
for(i=0;i<DPTOS;i++) {
cout<<"Personas que deben votar en el Dpto "<<i<<": "; cin>>votantes,i;
}
cout <<endl;
// Suma la matriz por columnas para dar el total de votos de cada partido
for(j=1;j<=6;j++){ total=0;
// Variable acumuladora, por lo cual hay que inicializarla en 0
for(i=0;i<DPTOS;i++){ total = total+votos,i,j; }
cout<<"Votos obtenidos por el partido P"<<j<<": "<<total<<endl;
}
system("pause");
return 0;
}
Valora esta pregunta


0