111 7777 bbbbbbb

LS_wuhaoxuan 2023-10-14 16:28:43 11 返回题目

#include <bits/stdc++.h> using namespace std;

int main() { char c[21]; scanf("%s",c); int a=0,b=0; for(int i=0; i<=12; i++) { if(c[i]>='0'&&c[i]<='9') { b++; int s=c[i]-'0'; a=s*b+a; if(b==9)break; } } if(a%11==c[12]-'0'||a%11==10&&c[12]=='X')printf("Right"); else { if(a%11==10) { for(int i=0; i<=11; i++)printf("%c",c[i]); printf("X"); } else { for(int i=0; i<=11; i++)printf("%c",c[i]); printf("%d",a%11); }

} return 0; }

{{ vote && vote.total.up }}