求大佬看看这个代码为什么只有50分(谢
查看原帖
求大佬看看这个代码为什么只有50分(谢
406817
Daaaaaaazai楼主2022/7/20 16:29
#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	char a,b,c,d,e,f,g,h,i,j;
	int check;
	scanf("%c-%c%c%c-%c%c%c%c%c-%c",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
	check=(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;
	check=check%11;
	if(j=='x'&&check==10||check==j-'0')
	{
		cout<<"Right"<<endl;
	}
	else{
		printf("%c-%c%c%c-%c%c%c%c%c-%c",a,b,c,d,e,f,g,h,i,check==10?'x':check+'0');
	}
	return 0;
} 
2022/7/20 16:29
加载中...