80WA求调玄关QWQ!
查看原帖
80WA求调玄关QWQ!
1401294
XCJHYJ楼主2024/11/28 21:51
#include<bits/stdc++.h>
using namespace std;
int a,b,c,n,s;
char d;
int main() {
	scanf("%d-%d-%d-%c",&a,&b,&c,&d);
	n=a*100000000+b*100000+c;
	for(int i=9; i>=1; i--)
		s+=n%10*i,n/=10;
	s%=11;
	if(s==d-'0') printf("Right");
	else if(s<10) printf("%d-%d-%d-%d",a,b,c,s);
	else printf("%d-%d-%d-X",a,b,c,s);
	return 0;
}

(记得@)

2024/11/28 21:51
加载中...