struct tax_info
{
int upper_bound;
double rate;
int tax_before; //不知道速扣的英语,当然速扣应该算是一个冗余数据吧
};
然后按照顺序存储,这样上次的upper_bound(如果没有就是0)就是这次的lower_bound,当然你也可以这样:
typedef struct
{
int lower_bound;
int upper_bound;
} range;
struct tax_info2
{
range r;
double rate;
int tax_before;
};