标签:xxxx += type its code sdn NPU 否则 can
0-670-82162-4
Right
#include<bits/stdc++.h> using namespace std; #define ll long long char c[18], s; int main() { scanf("%s", c); int ii = 1, sign = 0, len = strlen(c), sum = 0; for(int i = 0; i<len; i++) { if(sign<9 && c[i] != ‘-‘) { sum += ii*((int)c[i]-48); ii++; sign++; } } sum %= 11; if(sum == 10)s = ‘X‘; else s = sum+48; if(s == c[len-1])printf("Right\n"); else { for(int i = 0; i<len-1; i++) printf("%c", c[i]); printf("%c\n", s); } return 0; }
标签:xxxx += type its code sdn NPU 否则 can
原文地址:https://www.cnblogs.com/RootVount/p/10981318.html