首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
zxjrheaven
2025年3月14日 11:26
身份证校验 题解:暴力,已红温(不应该是Correct吗)
P1722
回复 0
|
赞 10
|
浏览 1.4k
#include <bits/stdc++.h> using namespace std; int weight[17]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; int quanzhi(string str) { int sum=0; for(int i=0;i<17;i++) { int a=str[i]-'0&...
Agnes03
2024年7月27日 11:11
身份证校验 题解:
P1722
回复 0
|
赞 63
|
浏览 2.0k
#include <bits/stdc++.h> using namespace std; int main(){ map<int,char> dict;//余数x和校验位y的对应规则 dict[0]='1';//一定要用单引号 dict[1]='0'; dict[2]='X';//注意X是大写 dict[3]='9'; dict[4]='8'; dict[5]='7'; dict[6]='6'; dict[7]='5'; dict[8]='4'; dict[9]='3'; dic...
Candour
2024年6月10日 18:37
身份证校验 (C++ ID Corrent没绷住)题解:
P1722
回复 0
|
赞 55
|
浏览 3.4k
没注意ID Corrent(ID Correct)WA一次 #include<bits/stdc++.h> using namespace std; int v[20] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; char c[20] = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; int main() { string num; while(cin >...
huanghu
2024年3月21日 10:51
身份证校验 题解:身份证校验c++
P1722
回复 0
|
赞 1
|
浏览 1.6k
#include <stdio.h> #include <iostream> #include <string> #include <string.h> #include <algorithm> #include <map> using namespace std; int main() { map<int, char> myMap; myMap[0] = '1'; myMap[1] = '0'; myMap[2] = 'X'; ...
Keeshpku
2023年3月16日 17:07
注意字符转换数字还有X是大写以及 correct它拼错了.
P1722
回复 1
|
赞 24
|
浏览 4.0k
#include <iostream> #include <string> using namespace std; int main(){ string x; int quan[50] = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; char yu[50] = {'1','0','X','9','8','7','6',...
lingdongyang
2024年3月18日 16:34
身份证校验 题解:
P1722
回复 0
|
赞 11
|
浏览 1.4k
#include<stdio.h> #include<string.h> int main() { char s[105]; int f[17] = { 7 ,9, 10, 5 ,8 ,4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };//前十七位的权值 while (gets(s) != NULL) { int len = strlen(s); int sum = 0;//前面权值相乘后相加 int x = 0;//余数 if (len != 18) { printf("ID Wr...
光明守护神
2024年3月7日 21:22
身份证校验 题解:C++
P1722
回复 0
|
赞 1
|
浏览 1.3k
#include<iostream> using namespace std; void error() { cout << "ID Wrong" << endl; } void corrent() { cout << "ID Corrent" << endl; } int main() { string s; while (cin >> s) { int n = s.size(); if (n != 18) error(); else ...
orderrr
2024年3月2日 17:51
身份证校验 题解:c
P1722
回复 0
|
赞 35
|
浏览 1.9k
#include <stdio.h> #include <string.h> int main() { char ch[20]; int num[17] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; char cnt[11] = {'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}; while (scanf("%s", ch) != EOF) { if ...
月溅星河
2024年2月6日 21:35
身份证校验 题解:
P1722
回复 0
|
赞 4
|
浏览 1.9k
#include <bits/stdc++.h> using namespace std; int main() { int weight[17] = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}; string s; while (cin >> s) { if (s.size() != 18) { cout << "ID Wrong" << endl; ...
Apricityxx
2023年10月26日 11:22
身份证校验 题解:
P1722
回复 0
|
赞 3
|
浏览 1.7k
// // 身份证校验.cpp // Algorithm // // Created by Apricity on 2023/10/26. /*身份证号的校验身份证号码共18位,最后一位是校验位。A[18] : aaaaaabbbbbbbbccc d 校验的规则如下: 身份证的前十七位数字和对应的权值相乘后相加后所得的和对11取余的余数与校验位(身份证最后一位)相同则身份证合法。 前十七位的权值分别是:7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 &nb...
1
2
3
题目
身份证校验
题解数量
25
发布题解
在线答疑
热门题解
1
身份证校验 题解:
2
身份证校验 (C++ ID Corrent没绷住)题解:
3
身份证校验 题解:
4
身份证校验 题解:C++ 数组
5
身份证校验 题解:
6
身份证校验 题解:c
7
注意字符转换数字还有X是大写以及 correct它拼错了.
8
身份证校验 题解:
9
身份证校验 题解:
10
身份证校验 题解: