sajdfklsdfadfdakgjd @ 2021-07-31 17:44:02
#include<stdio.h>
int main()
{
char a[20];
int sum=0,j=1;
for(int i=1;i<14;i++){
a[i]=getchar();
if(a[i]!='-'&&j<=9){
sum+=j*(a[j]-'0');
j++;
}
}
if(sum%11+'0'==a[13]||(sum%11==10&&a[13]=='X'))
printf("Right");
else{
a[13]=(sum%11==10)?'X':sum%11+'0';
for(int i=1;i<14;i++){
printf("%c",a[i]);
}
}
}
by 渡鸦2007 @ 2021-07-31 17:53:35
@sajdfklsdfadfdakgjd
for(int i=1;i<14;i++){
a[i]=getchar();
if(a[i]!='-'&&j<=9){
//sum+=j*(a[j]-'0');
//上一行改为
sum+=j*(a[i]-'0');
j++;
}
}
by sajdfklsdfadfdakgjd @ 2021-07-31 17:58:09
这次过了,我粗心了,O(∩_∩)O谢谢!