YgtVictor @ 2024-03-17 20:50:12
int main() { int a,b,c,d,e,f,g,h,i,s; char j; scanf("%d-%d%d%d-%d%d%d%d%d-%c",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j); s=a1+b2+c3+d4+e5+f6+g7+h8+i*9; int m=s%11; char ch; if(m==10) { ch='X'; } else{ ch= '0'+m; }
if(ch==j)
{
printf("Right");
}
else{
printf("%d-%d%d%d-%d%d%d%d%d-%c",a,b,c,d,e,f,g,h,i,ch);
}
return 0;
}
by YgtVictor @ 2024-03-17 21:09:11
@litjohn okok
by YgtVictor @ 2024-03-17 21:11:54
@Carey_chen 想起来了,可以用%1d
by YgtVictor @ 2024-03-17 21:14:35
@tni_retsigeR 谢谢指点