题解
2023-08-08 11:13:23
发布于:浙江
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
string n;
long long n1=0;
int main(){
int a,c=0;
cin>>a;
for(int i=1;i<=a;i++){
int b=0;
cin>>n;
for(int j=0;j<17;j++){
if(n[j]<'0'||n[j]>'9'){
b=1;
break;
}
if(n[j]=='0')n1+=7;
else if(n[j]=='1')n1+=0;
else if(n[j]=='2')n1+=1;
else if(n[j]=='3')n1+=3;
else if(n[j]=='4')n1+=2;
else if(n[j]=='5')n1+=9;
else if(n[j]=='6')n1+=4;
else if(n[j]=='7')n1+=6;
else if(n[j]=='8')n1+=8;
else if(n[j]=='9')n1+=5;
n1*=10;
}
n1/=10;
int bb=0;
while(n1){
bb+=n1%10;
n1/=10;
}
if(bb%17<=5)b=1;
if(b==1){
cout<<n<<endl;
c=1;
}
n1=0;
}
if(c==0)cout<<"all ok";
return 0;
}
这里空空如也
有帮助,赞一个