P1055 0分求助
查看原帖
P1055 0分求助
1097732
BaiduPhoto楼主2024/7/6 18:38
#include <iostream>
#include <string>
using namespace std;
int identification[15], code[13], ans=0;
int main()
{
    for (int i = 1; i <=13; i++)
    {
        cin >> identification[i];
        if(i!=2 || i!=6 || i!=12)
        for (int j = 1; j <= 10; j++)
        {
            code[j]=identification[i];
            ans+code[j]*(j-1);
        }
    }
    ans=ans%11;
    if (ans==10) ans=X;
    if (ans==identification[13])cout << "Right" << endl;
    else identification[13]=ans;
    for (int i = 1; i <=13; i++)
    {
        cout << identification[i];
    }
    return 0;
}
2024/7/6 18:38
加载中...