文章
6
粉丝
135
获赞
4
访问
16.6k
#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','5','4','3','2'};
while(cin>>x){
int ans = 0;
for(int i=0;i<x.size()-1;++i){
int y = x[i]-'0';
ans += y * quan[i];
}
if(yu[ans%11] == x[17]){ printf("ID Corrent\n");}
else{printf("ID Wrong\n");}
}
}
登录后发布评论