检验身份证
using namespace std;
int main()
{
int a[] = { 7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2 };
char b[] = { '1','0','x','9','8','7','6','5','4','3','2' };
char id[18];
char *str = new char[18];
int n;
cin >> n;
int sum = 0;
int i;
int z;
int j;
while (n--)
{
i = 0;
cin >> str;
char *p = str;
while (*p != 0)
{
sum += (*p - '0'*b[i++]);
p++;
}
z = sum % 11;
}
for (j = 0; j < 11; j++)
{
if (b[j] == z)
z = id[17];
}
cout << "All pauseed " << endl;
system("pause");
return 0;
}