if you have problems with constructors and destructors, you can insert such print statements in constructors for your real classes to see that they work as intended. For larger programs, this exact kind of tracing becomes tedious, but similar techniq
[取模] 所谓取模运算,就是计算两个数相除之后的余数,符号是%.如a % b就是计算a除以b的余数.用数学语言来描述,就是如果存在整数n和m,其中0 <= m < b,使得a = n * b + m,那么a % b = a - n * b = m. 取模运算的两个操作数都必须是整数,可以是负整数,但是b不可以是0,因为被除数不能为0嘛. 当a和b中存在负整数时,首先计算|a|%|b|=c,然后a%b的符号与b一致.也就是说,如果b>0,则a%b=c:如果b<0,则a%b=-c 比如