萌新求助!1055为什么不过
查看原帖
萌新求助!1055为什么不过
1045037
cyzyyds122楼主2023/9/26 21:35
#include <bits/stdc++.h>
using namespace std;
string pove(string a){
    int c[14];
    int m=0;
    for(int i=0;i<13;i++){
        if(a[i]!='-'){
            c[i]=int(a[i])-48;
        }else{c[i]=-1;}
    }
    int b;
    for(int i=0;i<11;i++){
        if(c[i]!=-1){
        	b++;
            m+=c[i]*(b);
        }
    }
    if(m%11==c[12]){
        return "Right";
    }
    return a;
}
int main() {
    string s;
    cin >> s;
    cout<<pove(s);
    return 0;
}

为什么过不了,蒟蒻第一做普及-,求助,输出我这边看来都对,但是全红wa。

2023/9/26 21:35
加载中...