标签:
题目:hdu1013, hdu1061, hdu1163, hdu1197.
or
dr(n) = (n-1)%9+1.
其中,n-1是为了将结果0-8匹配到1-9.
Reference:
[1] https://en.wikipedia.org/wiki/Digital_root
[2] https://en.wikipedia.org/wiki/Casting_out_nines
标签:
原文地址:http://www.cnblogs.com/wubdut/p/4739754.html