30分,求助!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

P1055 [NOIP2008 普及组] ISBN 号码

gjm123456 @ 2023-07-26 12:12:05

#include<bits/stdc++.h>
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]-48)*j++;
    }
    if(mod[t%11]=a[12])
        cout<<"Right";
    else
    {
        a[12]=mod[t%11];
        printf("%s",a);
    }
    return 0;
}

by _xm_ @ 2023-07-26 13:12:02

《大 写》


|