Classic
Clean & simple
Crystal
Glassmorphism + Neon
Cyberpunk
Neon glitch art
🚫
违规Action检测
禁止Use右键菜单
⚠️ 此Action已被系统记录
1

身份证

📝 Solutions 🔵 仅限 C++
Problems Description
&nbsp;如果让你设计items程序,用什么变量保存身份证号码呢?长整数可以吗?不可以!<br /> &nbsp; 因为有人的身份证最后一位是"X"<br /> &nbsp; 实际上,除了最后一位的X,不会出现其它字母!<br /> &nbsp; 身份证号码18位 = 17位 + 校验码<br /> &nbsp; 校验码的计算过程:<br /> &nbsp; 例如:身份证前17位 = ABCDEFGHIJKLMNOPQ<br /> &nbsp; A~Q 每位数字乘以权值求和(每位数字和它对应的“权”相乘后累加)<br /> &nbsp; 17位对应的权值points别是:<br /> &nbsp; 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2<br /> &nbsp; 求出的总和再对11求模<br /> &nbsp; 然后按下表映射:<br /> &nbsp; 余数&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 1&nbsp;&nbsp; 2&nbsp;&nbsp; 3&nbsp;&nbsp; 4&nbsp;&nbsp; 5&nbsp;&nbsp; 6&nbsp;&nbsp; 7&nbsp;&nbsp; 8&nbsp;&nbsp; 9&nbsp;&nbsp; 10 <br /> &nbsp; 校验码: 1&nbsp;&nbsp; 0&nbsp;&nbsp; X&nbsp;&nbsp; 9&nbsp;&nbsp; 8&nbsp;&nbsp; 7&nbsp;&nbsp; 6&nbsp;&nbsp; 5&nbsp;&nbsp; 4&nbsp;&nbsp; 3&nbsp;&nbsp; 2 <br /> 输入身份证前17位,打印出校验码。
Input格式
<p> &nbsp; </p>
Output格式
Sample
Sample Input 1
13072719840805463
Sample Output 1
X
Submit Code
请先Login后Submit

🤖 AI 解题助手

OpenRouter
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这problems题,可以帮你points析思路、提供Code示例。
🔓 完全Free · 无需消耗 Token