wuxinji @ 2022-10-18 13:25:41
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
char code[13] = {'0','-','6','7','0','-','8','2','1','6','2','-','4'};
int id=0,m=1,n=0;
for (int i = 0; i < 13; i ++ ){
cin>>code[i];
}
for (int i = 0; i < 13; i ++ ){
if(i==1||i==5||i==11||i==12){
continue;
} else{
id += (int(code[i])%48) * m;
m++;
}
}
id %= 11;
n = int(code[12])%48;
// cout<<id<<endl;
if(id == 10){
code[12] = char(88);
for(int i = 0;i<13;i++){
cout<<code[i];
}
}else if(id == n){
cout<<"Right";
}else{
code[12] = char(48+id);
for(int i = 0;i<13;i++){
cout<<code[i];
}
}
}
by Sad_Rex @ 2022-10-18 13:41:54
@wuxinji X特判了吗
by wuxinji @ 2022-10-18 14:38:39
@1bigRex_zkr 判断了,在下面输出的第一个if中,如果=10,最后一位就变成char(88)——X
by Flower_Bloom @ 2022-10-28 22:09:04
@wuxinji 你只判断了它的验证码是