Академический Документы
Профессиональный Документы
Культура Документы
h>
#include<conio.h>
void main()
char publico,infraccion,familiar,rpta;
int n,tipo,monto,totalsp,totalsf,totalmale,totalpalu,totalfama;
int malest=0,cmalest=0,palu=0,cpalu=0,fama=0,cfama=0,contc=0;
int malest1=0,cmalest1=0,palu1=0,cpalu1=0,fama1=0,cfama1=0,conto=0;
int malest2=0,cmalest2=0,palu2=0,cpalu2=0,fama2=0,cfama2=0,contt=0;
int malest3=0,cmalest3=0,palu3=0,cpalu3=0,fama3=0,cfama3=0,contp=0;
int cantc,canto,cantt,cantp;
scanf("%d",&n);
for(int i=1;i<=n;i++){
fflush(stdin);
scanf("%d",&tipo);
switch(tipo){
case 1:
fflush(stdin);
scanf("%c",&publico);
switch(publico){
case 'C':
case 'c':
do{
fflush(stdin);
scanf("%c",&infraccion);
fflush(stdin);
printf("\n ingrsar monto:");
scanf("%d",&monto);
switch(infraccion){
case 'M':
case 'm':
malest=malest+monto;
cmalest=cmalest+1;
break;
case 'P':
case 'p':
palu=palu+monto;
cpalu=cpalu+1;
break;
case 'F':
case 'f':
fama=fama+monto;
cfama=cfama+1;
break;
default:
fflush(stdin);
scanf("%c",&rpta);
}while(rpta=='s'||rpta=='S');
contc=contc+1;
break;
case 'O':
case 'o':
do{
fflush(stdin);
scanf("%c",&infraccion);
fflush(stdin);
scanf("%d",&monto);
switch(infraccion){
case 'M':
case 'm':
malest1=malest1+monto;
cmalest1=cmalest1+1;
break;
case 'P':
case 'p':
palu1=palu1+monto;
cpalu1=cpalu1+1;
break;
case 'F':
case 'f':
fama1=fama1+monto;
cfama1=cfama1+1;
break;
default:
fflush(stdin);
scanf("%c",&rpta);
}while(rpta=='s'||rpta=='S');
conto=conto+1;
break;
default:
}break;
case 2:
fflush(stdin);
scanf("%c",&familiar);
switch(familiar){
case 'T':
case 't':
do{
fflush(stdin);
scanf("%c",&infraccion);
fflush(stdin);
scanf("%d",&monto);
switch(infraccion){
case 'M':
case 'm':
malest2=malest2+monto;
cmalest2=cmalest2+1;
break;
case 'P':
case 'p':
palu2=palu2+monto;
cpalu2=cpalu2+1;
break;
case 'F':
case 'f':
fama2=fama2+monto;
cfama2=cfama2+1;
break;
default:
fflush(stdin);
scanf("%c",&rpta);
}while(rpta=='s'||rpta=='S');
contt=contt+1;
break;
case'P':
case'p':
do{
fflush(stdin);
scanf("%c",&infraccion);
fflush(stdin);
scanf("%d",&monto);
switch(infraccion){
case 'M':
case 'm':
malest3=malest3+monto;
cmalest3=cmalest3+1;
break;
case 'P':
case 'p':
palu3=palu3+monto;
cpalu3=cpalu3+1;
break;
case 'F':
case 'f':
fama3=fama3+monto;
cfama3=cfama3+1;
break;
default:
fflush(stdin);
scanf("%c",&rpta);
}while(rpta=='s'||rpta=='S');
contp=contp+1;
break;
default:
}break;
default:
cantc=cmalest+cpalu+cfama;
canto=cmalest1+cpalu1+cfama1;
cantt=cmalest2+cpalu2+cfama2;
cantp=cmalest3+cpalu3+cfama3;
if(cantc>canto||cantc>cantt||cantc>cantp)
}
else{
if(canto>cantc||canto>cantt||canto>cantp){
else{
if(cantt>cantc||cantt>canto||cantt>cantp){
else{
if(cantp>cantc||cantp>canto||cantp>cantt){
totalsp=contc+conto;
totalsf=contt+contp;
totalmale=malest+malest1+malest2+malest3;
totalpalu=palu+palu1+palu2+palu3;
totalfama=fama+fama1+fama2+fama3;
getch();