加权求和:就是乘以权值再做加法。
int weight[]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
...
cin>>s;
for(int j=0;j<17;j++)
{
m+=(s[j]-'0')*weight[j];
}