/*
    ・・・Q・・・・・・・・・・・Z・p・メ・・・ア    ・ス・ャ9・N・x・E・t・・・E・゚・・ ・・7
                                BohYoh Shibata PREPARATION
*/

#include  <stdio.h>

#define   STBMAX    61

typedef struct  { int x; int y; } ZAHYO;
void prtgraph( int, ZAHYO*, char* );

main()
{
    ZAHYO  s_tbl[STBMAX];
    FILE   *fp;
    long   yymmdd, t_yymmdd;
    int    t_bug, t_chk, i;
    int    idx = 0 ;
    char   tanto;

    fp = fopen( "bugrec.txt", "r" );
    yymmdd = 0;
    s_tbl[0].x = s_tbl[0].y = 0;
    while( fscanf( fp, "%8ld %c %2d %2d\n",
                   &t_yymmdd, &tanto, &t_chk, &t_bug )
           != EOF ){
        if ( yymmdd != t_yymmdd ) {
            idx++;
            yymmdd = t_yymmdd;
            s_tbl[idx].x = s_tbl[idx].y = 0;
        }
        s_tbl[idx].x += t_chk;
        s_tbl[idx].y += t_bug;
    }
    fclose( fp );

    for ( i=0; i <idx; i++ ) {
        s_tbl[i+1].x += s_tbl[i].x;
        s_tbl[i+1].y += s_tbl[i].y;
    }
    prtgraph( idx + 1, s_tbl, "・M・・・x・ャ・キ・ネ・・" );
}