4 int main(int argc
,char **argv
)
6 char w1
[750],w2
[750],w3
[750];
7 char ow1
[750],ow2
[750],ow3
[750];
8 double count
,total_count
;
14 sscanf(argv
[1],"%d",&n_digit
);
15 for (base
= 1;n_digit
> 0; n_digit
--) base
*= 10;
17 while (scanf("%s %s %lf",w1
,w2
,&count
) == 3) {
18 if (!strcmp(w1
,ow1
) && !strcmp(w2
,ow2
))
22 printf("%s %s %Ld\n",ow1
, ow2
, (long long int)(total_count
*base
) > 0 ? (long long int)(total_count
*base
) : (long long int)1);
30 Force to long long int because <s> <digit>/<opaque>/<punct>
31 can easily run over int limit
33 if ((long long int)(total_count
*base
) > 0)
34 printf("%s %s %Ld\n",ow1
, ow2
, (long long int)(total_count
*base
) > 0 ? (long long int)(total_count
*base
) : (long long int)1);