#include<iostream>
using namespace std;
int main()
{
int flag=1,n,t,len=0,sum=0;
int quan[]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
char test[]={'1','0','X','9','8','7','6','5','4','3','2'};
scanf("%d",&n);
t=n;
char id[n][19];
for(int i=0;i<n;i++)
{
for(int j=0;j<18;j++)
{
cin>>id[i][j];
}
}
for(int i=0;i<n;i++)
{
len=0;
while(len<18)
{
sum+=(quan[len])*(id[i][len]-48);
len++;
}
if(test[sum%11]!=id[i][17])
{
for(int j=0;j<18;j++)
printf("%c",id[i][j]);
flag=0;
printf("\n");
}
sum=0;
}
if(flag)
printf("All passed");
return 0;
}
打卡3.11
最新推荐文章于 2024-08-18 21:07:18 发布