#include main() { char s[10],s1[10], s2[10], s3[10], s4[10]; int i=0,a[20][20]; int num; int j=0; int totalA=0, totalB=0, totalC=0, totalD=0; int ii; int total[4]={0}; int max; char rank[]={'A', 'B', 'C', 'D'}; int mostvote, secondmost; char most, second; scanf("%s%s%s%s%s",s,s1,s2,s3,s4); scanf("%s",s); printf("%s %s %s\n",s, s1, s2); while( scanf("%d %d %d %d %d",&j,&a[i][0], &a[i][1], &a[i][2], &a[i][3] ) >4) { i++;} num = i; printf("The mumber of precinct is %d\n",num); for(i=0;i max) {max=total[i]; ii=i;} int allvotes=0; for(i=0;i<4;i++) allvotes +=total[i]; if(max > (0.5*allvotes) ) { printf("Candidate %c is the winner\n",rank[ii]); } else { mostvote = max; most = rank[ii]; total[ii]=0; //Noe the second most i=0; ii=i; max=total[i]; for(i=1;i<4;i++) if (total[i] > max) {max=total[i]; ii=i;} secondmost = max; second=rank[ii]; printf("Runoff between candidates %c and %c\n",most, second); } }