文章
105
粉丝
69
获赞
117
访问
56.9k
没注意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 >> num)
{
if(num.size() != 18)
{
cout << "ID Wrong" << endl;
continue;
}
int sum = 0;
for(int i = 0; i < 17; i ++)
sum += ((num[i] - '0') * v[i]);
if(c[sum % 11] == num.back()) cout << "ID Corrent" << endl;
else cout << "ID Wrong" << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发