sksla @ 2024-03-28 20:37:56
只有2 3 8 10过了
#include<bits/stdc++.h>
using namespace std;
char id(char s[13])
{
int all=0;
int k=0;
for(int i=0;i<11;i++)
{
if(s[i]!='-')
{
k++;
all+=(s[i]-'0')*k;
}
}
char result=all%11+'0';
if(result=='10')
result='X';
return result;
}
int main()
{
char iden,s[13];
cin>>s;
if(s[12]==id(s))
cout<<"right"<<endl;
else
{
s[12]=id(s);
cout<<s;
}
return 0;
}