ACM algorithm exercises-—— zju1164-software CRC

Source: Internet
Author: User
Tags generator

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.