标签:cout pre als ret algorithm namespace nbsp stream else
#include <iostream> #include <algorithm> using namespace std; int arr[10005]; int toNum(char ch) {return ch - ‘0‘;} int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int num = toNum(s[0]) + toNum(s[2]) * 2 + toNum(s[3]) * 3 + toNum(s[4]) * 4 +toNum(s[6]) * 5 + toNum(s[7]) * 6; num += toNum(s[8]) * 7 + toNum(s[9]) * 8 + toNum(s[10]) * 9; if ((s[12] == ‘X‘ && num % 11 == 10) || (num % 11 == toNum(s[12]))) cout << "Right" << endl; else { if (num % 11 == 10) s[12] = ‘X‘; else s[12] = ‘0‘ + num % 11; cout << s << endl; } return 0; }
标签:cout pre als ret algorithm namespace nbsp stream else
原文地址:https://www.cnblogs.com/AntonLiu/p/11161383.html