- 2024庆元旦积分赛
耗时0.7小时终于做对了!!!!!!!!!!!
- 2024-1-2 18:42:17 @
😄 ```
#include<bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
int cum=a.size();
int k=1,sum=0;
for(int i=0;i<cum-1;i++){
if(a[i]=='-') continue;
sum+=(a[i]-'0')*k;
k++;
}
if(sum%11==10 && a[cum-1]=='X' || sum%11==a[cum-1]-'0'){
cout<<"Right";
}else{
for(int i=0;i<cum-1;i++){
printf("%c",a[i]);
}
printf("%c",sum%11==10 ? 'X':sum%11+48);
}
return 0;
}
1 comments
-
经开一中2026届11班关泽瑞 LV 6 @ 2024-1-2 20:51:18
so?😑
- 1