claro creo que me explique mal.
ya tengo la mayoria de programs hechos, tengo una duda con el de votaciones como puedo hacer para que me brinde una tabla con departamentos.
MOD: Etiquetas GeShi.
ya tengo la mayoria de programs hechos, tengo una duda con el de votaciones como puedo hacer para que me brinde una tabla con departamentos.
Código (c) [Seleccionar]
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
// CONTROLES: EN LA VOTACION 1 SIRVE PARA VOTAR POR EL CANDIDATO A,
//2 SIRVE PARA VOTAR POR EL CANDIDATO B, SI SE INGRESA OTRO NUMERO SE TOMARA COMO VOTO NULO
//EN LA SEGUNDA PREGUNTA 0 SIRVE PARA SEGUIR VOTANDO Y 1 PARA BRINDAR RESULTADOS DE LOS VOTOS
main ()
{
unsigned int cand_A = 0, cand_B = 0, nulos = 0;
unsigned int voto, seguir;
bool votacion_activa = true;
printf(" \n****************************************************************************** ");
printf(" \n*********************** PROGRAMA DE VOTACIONES ******************************* ");
printf(" \n****************************************************************************** ");
// este bucle se va ejecutando hasta que le decimos al programa que queremos cerrar la votacion
while(votacion_activa) {
printf(" \n MI VOTO ES PARA EL CANDIDATO (1= CANDIDATO A, 2= CANDIDATO B, O NULO): ");
scanf("%i", &voto);
switch(voto) {
case 1:
cand_A++;
break;
case 2:
cand_B++;
break;
default: nulos++;
}
printf(" TU VOTO A SIDO PROCESADO, DESEAS SEGUIR CON LA VOTACION (1 = NO, 0 = SI): ");
scanf("%i", &seguir);
if(seguir == 1) votacion_activa = false;
}
//RESULTADO DE VOTACIONES
printf(" \n \n RESULTADOS DE VOTACION ");
printf(" \n ________________________ ");
printf(" \n \n SE HAN REGISTRADO %i VOTOS: ", cand_A + cand_B + nulos);
if(cand_A != cand_B) {
printf("\n EL GANADOR A SIDO EL CANDIDATO: ");
if(cand_A > cand_B) printf(" A, CON UN TOTAL DE %i VOTOS.", cand_A);
else printf(" B, CON UN TOTAL DE %i VOTOS.", cand_B);
}
else printf(" \n SE A PRODUCIDO UN EMPATE ENTRE LOS CANDIDATOS ");
printf(" \n EN TOTAL A HABIDO %i VOTOS NULOS", nulos);
printf(" ");
getch();
}
MOD: Etiquetas GeShi.