Aurora3545 @ 2024-11-04 11:14:23
蒟蒻求助
#include<bits/stdc++.h>
using namespace std;
char a[15];
int b[10],x=1,ans;
void print(char x[15]){
for(int i=0;i<=11;i++){
cout<<a[i];
}
cout<<ans;
}
int main(){
cin>>a;
for(int i=0;i<12;i++){
if(a[i]>='0' && a[i]<='9'){
b[x]=a[i]-'0';
x++;
}
}
for(int i=1;i<=9;i++){
//cout<<b[i];
ans+=b[i]*i;
}
ans%=11;
if(ans==a[12]-'0') cout<<"Right";
else print(a);
return 0;
}
by zhangboyong @ 2024-11-04 11:30:03
@Aurora3545 没有判 ans==10
是 X