求救啊,哪里扣了10分,求大佬解答

P1055 [NOIP2008 普及组] ISBN 号码

@[yh123](/space/show?uid=153166) #include<iostream> #include<cstdio> #include<string> using namespace std; int main() { char x[13]; int y[13]; int a=0; for(int i=0;i<13;i++) { cin>>x[i]; } for(int i=0;i<12;i++) { if(x[i]=='-') continue; else y[a++]=x[i]-48; } int b=0,sum=0,c=0; for(int i=0;i<9;i++) { b=y[i]*(i+1); sum+=b; } c=sum%11; if(c==x[12]) { cout<<"Right"<<endl; } if(c==10&&x[12]=='X') { cout<<"Right"<<endl; } else if(c==10) { for(int i=0;i<13;i++) { x[12]='X'; cout<<x[i]; } } else { for(int i=0;i<13;i++) { x[12]=(char)(c+48); cout<<x[i]; } } return 0; }
by yh123 @ 2018-11-23 14:18:05


。。。这个怎么展开
by yh123 @ 2018-11-23 14:18:56


希望更丰富的展现?使用Markdown
by smallfang @ 2018-11-23 15:17:36


# 希望更丰富的展现?使用Markdown
by smallfang @ 2018-11-23 15:17:42


希望更丰富的展现?使用Markdown
by 2x6_81 @ 2018-11-23 15:29:06


希望更丰富的展现?使用Markdown
by 灵光一闪 @ 2018-11-23 18:12:14


```cpp #include<iostream> #include<string> using namespace std; int main() { string s; cin>>s; long int ans=0,q=0,a; for(int i=0;i<s.size()-1;i++) { if(s[i]-'-'==0) { q++; //cout<<0<<" "; continue; } else { //cout<<1<<" "; a=s[i]-'0'; ans+=(i-q+1)*a; } } //cout<<ans; //cout<<s[12]-'0'; //return 0; ans=ans%11; if(ans==s[12]-'0'||(ans==10&&s[12]-'X'==0)) { cout<<"Right"; } else { if(ans==10) { s[12]='X'; } else { s[12]=ans+'0'; } cout<<s; } return 0; } //满分答案 ```
by 灵光一闪 @ 2018-11-23 18:14:01


[证据(逃](https://www.luogu.org/problemnew/show/P1055)
by 灵光一闪 @ 2018-11-23 18:15:13


不好意思,发错了
by 灵光一闪 @ 2018-11-23 18:16:11


[这儿](https://www.luogu.org/record/show?rid=11957775)
by 灵光一闪 @ 2018-11-23 18:17:11


| 下一页