还有两个测试点实在找不出哪里错了

回复帖子

@本卿 2019-04-20 11:44 回复

include<iostream>

using namespace std; int main() { char a[14]; int i; cin >> a; int num; for (i = 0; i < 13; i++) { if (i == 1 || i == 5 || i == 11) continue; else a[i] -= '0'; } num = (a[0]+2a[2]+3a[3]+4a[4]+5a[6]+6a[7]+7a[8]+8a[9]+9a[10])%11; if (num == a[12]) cout << "Right" << endl; else { for (i = 0; i < 12; i++) { if (i == 1 || i == 5 || i == 11) cout << "-"; else { cout <<(int) a[i]; } } if (num >= 10) cout << 'X'; else cout << num; } system("pause"); return 0; }

@_⁢  2019-04-20 12:55 回复

${}^\text{希}_\text{展}\!code^\text{使}_M$

@Dengshuaizeng 2019-04-29 21:48 回复

测例子 1-370-82162-X Right

1-370-82162-0 1-370-82162-X

0-670-82162-4 Right

0-670-82162-0 0-670-82162-4

0-670-82162-X 0-670-82162-4
这个能跑对,应该就成了