求助!!!我是50分!!!
查看原帖
求助!!!我是50分!!!
872300
zhwandzyy楼主2023/4/27 22:04
#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[14];
	int b[14];
    for(int i=1;i<=13;i++)
    {
    	cin>>a[i];
    	b[i]=a[i]-48;
	}
    int sum=b[1]*1+b[3]*2+b[4]*3+b[5]*4+b[7]*5+b[8]*6+b[9]*7+b[10]*8+b[11]*9;
    if(sum%11==b[13])
    {
    	cout<<"Right"; 
	}
	else
	{
		for(int i=1;i<=12;i++)
		{
			cout<<a[i];
		}
		cout<<sum%11;
	}
	return 0;
 } 

向诸位大佬求助!!!!

2023/4/27 22:04
加载中...