lijizhen_1101 @ 2024-05-05 21:13:49
#include<bits/stdc++.h>
using namespace std;
int sum,n=13;
char a[15];
int main()
{
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++)
{
sum=(a[1]-'0')*1+(a[3]-'0')*2+(a[4]-'0')*3+(a[5]-'0')*4+(a[7]-'0')*5+(a[8]-'0')*6+(a[9]-'0')*7+(a[10]-'0')*8+(a[11]-'0')*9;
if(sum%11==(a[13]-'0') || sum%11==10&&a[13]=='X')
{
cout<<"Right"; return 0;
}else{
for(int i=1;i<=12;i++) cout<<a[i]; break;
}
}
cout<<sum%11;
return 0;
}
by jesse1216 @ 2024-05-05 21:21:07
cout<<sum%11;
如果 X
。
by jesse1216 @ 2024-05-05 21:21:44
笔误
by peak2024 @ 2024-05-11 16:17:37
如果sum=10,应该输出 X。