c语言30分求助

P1055 [NOIP2008 普及组] ISBN 号码

HHll1 @ 2023-10-10 13:55:47

#include <cstdio>
#define int long long
char s[250], mod[12] = "0123456789X", tot;
signed main()
{
    scanf("%s", s);
    for (int i = 0, j = 1; i < 12; i++)
    {
        if (s[i] == '-') continue;
        else j++, tot += (s[i] - '0') * j;
    }
    if (mod[tot % 11] == s[12]) puts(s);
    else s[12] = mod[tot % 11], puts("Right");
}

样例过了,但是30分,个位大佬帮忙看一下哪里错了,谢谢


|