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 ... 阅读全文
浙公网安备 33010602011771号