编译失败,大神帮看下。

P1055 [NOIP2008 普及组] ISBN 号码

abenben @ 2021-11-28 11:27:11

#include<iostream>

using namespace std;
int main()
{
    char a[13];
    int is=0,flag=1;    
    for(int i=0;i<13;i++)cin>>a[i];
    for(int i=0;i<11;i++)
    {
        if((i!=1)&&(i!=5))
        {       
            is=is+(a[i]-'0')*flag;      
            flag++; 
        }       
    }
    is=is%11;
    if (is==10&&a[12]=='X'||is==a[12]-'0')
        cout<<"Right";
    else
        {           
            a[12]=is+'0';
            cout<<a;
        }   
    return 0;   
}

编译失败

        Judger Internal Error

Traceback (most recent call last): File "/app/luogu-judger/source/tasks/Compile.py", line 60, in compile enable_o2=enable_o2) File "/app/luogu-judger/source/compiler/Compiler.py", line 69, in compile writable_files=[work_dest_path, work_dir]) File "/app/luogu-judger/source/executor/LrunExecutor.py", line 73, in execute raise RuntimeError("Unexpected lrun failure with exit code " + str(ret)) RuntimeError: Unexpected lrun failure with exit code 13


by chubei_AC @ 2021-11-28 11:29:25

@abenben 你谷日爆


by qjxqjx @ 2021-11-28 11:38:12

错了个P


by qjxqjx @ 2021-11-28 11:39:12

o,交luogu就爆了


by Mary_mzxx @ 2021-12-06 20:08:44

你这个肯定错:

#include<iostream>
#include<cstring>
using namespace std;
char s[14],c;
int main(){
    cin>>s;
    int h=0,k=0;
    for(int i=0;i<11;i++){
        if(s[i]!='-'){
            k++;
            h+=k*(s[i]-'0');
        }
    }
    h%=11;
    if(h==10){
        c='X';
    } 
    else{
        c=h+'0';
    }
    if(c==s[12]){
        cout<<"Right";
    }
    else{
        s[12]=c;
        cout<<s;
    }
    return 0;
}

试试这个,应该是AC


|