2013年4月27日

uva128 - 软件CRC

摘要: 不算的对原串进行取余,,做后结合余数得出CRC码r是最后的余数,m是34943,因为(r*256*256+c)%m==0所以最小的c是使得(r*256*256+c)==m的值所以c = m-(r*256*256)%m代码如下:#include #include #define M 1100 char s[M]; const int m = 34943; int solve(int len) { long long ans = 0; for(int i = 0; i < len; i++) ans = (ans*256+s[i])%m; return ... 阅读全文
posted @ 2013-04-27 17:09 Primo... 阅读(143) 评论(0) 推荐(0)