Specific topic description Point this link http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1164
This problem, to tell the truth, I do not understand-.-
I'm going to stick this code in here, and for this reason I'm going to study it.
1#include <stdio.h>2 #defineGenerator 349433 4 intMain ()5 {6UnsignedCharC,flag;7 intCount//number of characters in a row8 //data structure of CRC9 UnionTen { OneUnsignedintL; A struct - { -UnsignedCharB1; theUnsignedCharB2; -UnsignedCharB3; -UnsignedCharb4; - } CRC; + }data; - + while(1) A { atCount=0; -Data. L=0; - while(SCANF ("%c", &c) &&c!='\ n') - { -count++; -flag=C; inData. L= (data. l<<8) +c)%Generator; - } to +Data. L= (data. l<< -) +c)%Generator; - if(Data. l!=0) data. l=generator-data. L; the if(count==1&&flag=='#') Break; *printf"%02x%02x\n",(int) Data.crc.b2, (int) data.crc.b1); $ }Panax Notoginseng return 0; -}
ACM algorithm exercises-—— zju1164-software CRC