Joke Collection Website - Public benefit messages - Use c language programming to find the verification code of the 18-digit ID card
Use c language programming to find the verification code of the 18-digit ID card
In addition to what was said above, I would like to add one more point
1: char id[19]; ??//The last byte is used for '\0'
2: In addition to this reason, another more important thing is that gets gets all characters, in your jisuan function, in the for loop
result+=((*p)*(* q));
This sentence is actually the multiplication of the ASCII codes of the characters, not the multiplication of numbers. It can be changed to
(((*p) - '0' ) * ((*q) - '0'));
This is the multiplication of the numbers corresponding to the characters (is this easy to understand?)
3: Although jisuan returns is a relatively small number, but when calculating in a for loop, defining the result as char type will cause overflow, which will affect your results. I suggest changing it to unsigned int
- Related articles
- How to intercept the short message of loan?
- What are Java thread groups, thread pools, and thread queues? What's the difference?
- Does Zhengzhou Jinshui Road Sub-branch of China CITIC Bank rest on Sunday?
- Heart can't receive verification code every day.
- The mobile phone verification code of Shanghai New Energy Vehicle Selection cannot be received.
- How to edit and buy school uniforms in class groups
- What's the difference between Nokia SIS and SIXX?
- What does the WeChat icon mean?
- Xiaomi's short message is silent
- How to confess to Gemini boys without being rejected