标签:clu space str get bst mes names ret lse
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
int n;
bool judge(string s)
{
long long t1, t2, t3;
stringstream ss;
/*ss.clear();
ss << s;
ss >> t1;
string s1 = s.substr(0,(int) s.size() / 2);
ss.clear();
ss << s1;
ss >> t2;
ss.clear();
ss << s.substr((int)s.size() / 2);
ss >> t3;*/
t1 = stoi(s);
t2 = stoi(s.substr(0, s.size() / 2));
t3 = stoi(s.substr(s.size() / 2));
if (t2*t3 != 0)
{
if (t1 % (t3*t2) == 0) return true;
}
return false;
}
int main()
{
cin >> n;
while (n--)
{
string t;
cin >> t;
if (judge(t))printf("Yes\n");
else printf("No\n");
}
getchar();
getchar();
return 0;
}
---------------------------
注意,如果t2*t3 =0 ,t1%(t2*t3)会出现浮点错误
标签:clu space str get bst mes names ret lse
原文地址:https://www.cnblogs.com/zxzmnh/p/11692217.html