3 条题解

  • 0
    @ 2025-4-25 19:44:07

    #include<bits/stdc++.h> using namespace std;

    int main() { char a[14];

    for(int i=0;i<13;i++)
    	cin>>a[i];
    	
    int x=0,c=0;
    for(int i=0;i<12;i++)
    	if(a[i]>='0'&&a[i]<='9')
     	{   
    		c++;
      			x+=(a[i]-'0')*c;
    	}
    		 
    int y;
    if(x%11==(a[12]-'0'))	
    	y=1;
    else if(x%11!=10)
    {
    	y=0;
    }
    else if(x%11==10)
    {
    	if(a[12]=='X')
    		y=1;
    	else
    		y=0;
    }
    
    if(y==1)
    	cout<<"Right";
    else
    {
    	for(int i=0;i<12;i++)
    		cout<<a[i];
    	
    		if(x%11!=10)	
    			cout<<x%11;
    		else if(x%11==10)
    			cout<<"X";
    }	
    	
    return 0;
    

    }

    信息

    ID
    160
    时间
    1000ms
    内存
    16MiB
    难度
    8
    标签
    递交数
    110
    已通过
    19
    上传者