AC
2023-08-11 10:48:04
发布于:河北
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int mp[13];
void init()
{
mp[0] = 7;
mp[1] = 0;
mp[2] = 1;
mp[3] = 3;
mp[4] = 2;
mp[5] = 9;
mp[6] = 4;
mp[7] = 6;
mp[8] = 8;
mp[9] = 5;
}
int main()
{
bool b = true;
int t;
cin >> t;
init();
while(t--)
{
bool l = true;
int cnt = 0;
string s;
cin >> s;
for(int i = 0; i < s.size(); i++)
{
if(s[i] >= '0' && s[i] <= '9') cnt += mp[s[i] - '0'];
else l = false;
}
if(cnt % 17 <= 5 || l == false)
{
b = false;
cout << s << endl;
}
}
if(b) cout << "all ok" << endl;
}
这里空空如也
有帮助,赞一个