过不了,为啥呢?求大佬解答
查看原帖
过不了,为啥呢?求大佬解答
1031106
SuperJAR楼主2024/3/12 13:22

球球大佬解答,为什么只能拿到80分!!!谢谢!!!

#include<iostream>
#include<fstream>
#include <iomanip>
#include <bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <cstring>
using namespace std;
int main()
{
	char a,b,c,d,e,f,g,h,i,x;
	scanf("%c-%c%c%c-%c%c%c%c%c-%c",&a,&b,&c,&d,&e,&f,&g,&h,&i,&x);
	int k=(a-'0')*1+(b-'0')*2+(c-'0')*3+(d-'0')*4+(e-'0')*5+(f-'0')*6+(g-'0')*7+(h-'0')*8+(i-'0')*9;
	int m=k%11;
	if(m==(x-'0'))cout<<"Right";
	else if(m==10) printf("%c-%c%c%c-%c%c%c%c%c-X",a,b,c,d,e,f,g,h,i);
	else printf("%c-%c%c%c-%c%c%c%c%c-%d",a,b,c,d,e,f,g,h,i,m);
	return 0;
}

2024/3/12 13:22
加载中...