1 solutions

  • 1
    @ 2024-11-26 20:10:52

    #include using namespace std; int main(){ char a[14],mod[12]="0123456789X"; scanf("%s",a); int i,j=1,t=0; for(i=0;i<12;i++){ if(a[i]=='-') continue; t+=(a[i]-'0')*j++; } if(mod[t%11]==a[12]) cout<<"Right"; else{ a[12]=mod[t%11]; printf("%s",a); } return 0; }

    Information

    ID
    3820
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    7
    Accepted
    1
    Uploaded By