summaryrefslogtreecommitdiffstats
path: root/util/gamble_fix.c
blob: 05d536e5335694ad839e736ce86e51685a185167 (plain) (blame)
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
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    FILE *fp;
    char buf[100];
    int i, j, count[8]={0,0,0,0,0,0,0,0};
    if(argc<2) 
     {
        printf("useage example:%s ticket.user\n", argv[0]);
        return 0;
     }
    fp=fopen(argv[1], "r");
    if(!fp) return 0;
    while(fscanf(fp,"%s %d %d", buf, &i,  &j)!=EOF )
             {
                    count[i]+=j;
             }
    for(i=0; i<8; i++)
         {
             printf("%d) %d\n",i+1, count[i]);
         }
    return 0;
}