-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
48 lines (32 loc) · 1.01 KB
/
main.c
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
#include "header.h"
void main() {
srand(time(NULL));
LISTCANDIDAT lst;
int permission=0;
int numsOfcandidate,choose;
const char* filename;
int counter;
filename = "binaryFile.bin";
counter = 0;
int* arrWin = (int*)malloc(sizeof(int) * COL);
checkalloction(arrWin);
while (permission != 1) {
choose= principaleMenu(&lst,filename,&numsOfcandidate,&counter,arrWin);
if (choose != 2) {
arrWin = columnWin();
//at this point i have the column winner and the list of list
searchHowManyfindForEveryCandidate(&lst, arrWin);
getAvg(&lst);
getTheCandidateWithTheHigherAvg(lst);
//helperToPrint(lst);
sortTheColumn(&lst);
printTheArrayWiner(arrWin);
getTheNumsOfEvryGoodChoiseForAllThePlayers(lst);
helperToPrint(lst);
printf("there was %d candidate at this round \n", numsOfcandidate);
printf("please press any key for continue \n");
getchar();
saveDataToMyFile(lst, numsOfcandidate, arrWin, filename);
}
}
}