文章
37
粉丝
98
获赞
4
访问
22.2k
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string s;
getline(cin, s);
int len = s.size();
int sum = 0, cnt = 1;//cnt代表乘数
for (int i = 0; i < len-2; i++) {
if (s[i] != '-') {
sum += (s[i] - '0') * cnt;
cnt++;
}
}
int flag = sum % 11;
char tem;
if (flag == 10) {
tem = 'X';
}
else {
tem = '0' + flag;
}
if (tem==s[len-1]) {
&...
登录后发布评论
暂无评论,来抢沙发