Abcdefghijkl @ 2022-09-19 23:17:26
测试点一应该输出的是Right,但我这边不会进入第一个if
#include<stdio.h>
int main ()
{
int a,b,c,d,e,f,g,h,i;
scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-",&a,&b,&c,&d,&e,&f,&g,&h,&i);
char j;
scanf("%c",&j);
int total;
total=a+2*b+3*c+4*d+5*e+6*f+7*g+8*h+9*i;
int awa;
awa=total%11;
char qwe;
qwe=awa;
if((qwe==j&&awa!=10)||(qwe==10&&(int)j==88)){
printf("Right");
}
else if(qwe!=j||(awa==10&&j!=88)){
printf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-",a,b,c,d,e,f,g,h,i);
if(awa==10){
printf("X");
}
else{
printf("%1d",awa);
}
}
return 0;
}