Dev-c++全过,样例也对了,但只有30分(1,4,7过)
查看原帖
Dev-c++全过,样例也对了,但只有30分(1,4,7过)
746368
Lve_Zxy楼主2022/8/6 19:12
#include<bits/stdc++.h>
using namespace std;
int n,cur,a,b,c;
char d;
main(){
	ios::sync_with_stdio(0);
	scanf("%d-%d-%d-%c",&a,&b,&c,&d);
	n+=a;
	n+=b/100*2+b%100/10*3+b%10*4;
	n+=c/10000*5+c%10000/1000*6+c%1000/100*7+c%100/10*8+c%10*9;
	n%=11;
	//cout<<n<<" "<<d;
	//if(n==t)cout<<"cmsndhhhd";
	int t=d-48;
	if(n==10&&d=='X')cout<<"Right";
	else if(n==t)cout<<"Right";
	else{
		printf("%d-%d-%d-",a,b,c);
		if(n==10)cout<<"X";
		else cout<<n;
	} 
}
2022/8/6 19:12
加载中...