_sk123 @ 2022-04-05 19:45:28
#include<stdio.h>
int main()
{
char a[14];
char b[]={"0123456789X"};
int n=0,j=1,i,x;
scanf("%s",a);
for(i=0;i<12;i++)
{
if(a[i]>='0'&&a[i]<'9')
{ n+=j*(a[i]-'0');
j++; }
}
x=n%11;
if(b[x]==a[12]) printf("Right");
else
{ a[12]=b[x];
printf("%s",a); }
return 0;
}
by Horal @ 2022-04-05 20:02:31
if(a[i]>='0'&&a[i]<'9')
蒟蒻认为:是if(a[i]>='0'&&a[i]<='9')
//当然,也可能不对
by zongza @ 2022-04-05 20:16:12
if(a[i]>='0'&&a[i]<'9') 应该是if(a[i]>='0'&&a[i]<='9')吧。
by _sk123 @ 2022-04-05 21:25:44
@我叫zjs 就是少了个=,感谢感谢!
by _sk123 @ 2022-04-05 21:26:26
@zongza 对,是这样的,感谢感谢