打表出省一!
查看原帖
打表出省一!
1046736
Tangzhuo楼主2025/8/2 20:24
#include <bits/stdc++.h>
using namespace std;
int main() {
	int s1,s2,s3,s4,s5,s6,s7,s8,s9,s=0,n;
	string str;
	cin>>str;
	s1=str[0]-48;
	s2=str[2]-48;
	s3=str[3]-48;
	s4=str[4]-48;
	s5=str[6]-48;
	s6=str[7]-48;
	s7=str[8]-48;
	s8=str[9]-48;
	s9=str[10]-48;
	n=str[12];
	s+=s1;
	s+=s2*2;
	s+=s3*3;
	s+=s4*4;
	s+=s5*5;
	s+=s6*6;
	s+=s7*7;
	s+=s8*8;
	s+=s9*9;
	s=s%11;
	//cout<<n<<' '<<s<<endl;
	if(s==10){
		s=88;
		if(s==n){
			cout<<"Right";
		}else{
			cout<<s1<<'-'<<s2<<s3<<s4<<'-'<<s5<<s6<<s7<<s8<<s9<<'-'<<'X';
		}
		return 0;
	}
	if(s==n-48){
		cout<<"Right";
	}else{
		cout<<s1<<'-'<<s2<<s3<<s4<<'-'<<s5<<s6<<s7<<s8<<s9<<'-'<<s;
	}
    return 0;
}

2025/8/2 20:24
加载中...