P1055厌氧代码求助
查看原帖
P1055厌氧代码求助
1177631
Seniorsocialiewithme楼主2024/8/10 20:46
#include<bits/stdc++.h>
using namespace std;
char s[101];
int a[101];
int cnt;
int main(){
    scanf("%c-%c%c%c-%c%c%c%c%c-%c",&s[1],&s[2],&s[3],&s[4],&s[5],&s[6],&s[7],&s[8]);
	cnt+=(s[1]-48)*2+(s[2]-48)*3+(s[3]-48)*4+(s[4]-48)*5+(s[5]-48)*6+(s[6]-48)*7+(s[7]-48)*8+(s[8]-48)*9;
	cnt=cnt%11;
	cin>>s[9];
	if(s[9]=='X')s[9]='10';
	if(cnt==s[9]-48){
		cout<<"right";
	}else{
		cout<<cnt;
	}
}
2024/8/10 20:46
加载中...