1 1132 Cut Integer
简单题,最后自己给自己挖了个坑。AC:
cpp
#include<bits/stdc++.h>
using namespace std;
//模拟
typedef long long ll;
int main()
{
int n;
cin >> n;
while(n--){
string x;
cin >> x;
int x1 = stoi(x);
int num = x.size() / 2;
int left = 0,right = 0;
int p = 1;
for(int i = num - 1; i >= 0 ; i--)
{
left += (x[i] - '0')*p;
right += (x[i+num] - '0')*p;
p*=10;
}
if(left == 0 || right == 0)cout << "No" << endl;
else
{
// if(x1 % left == 0 && x1 % right == 0) // 自己给自己挖坑 !! 想不到样例 但过不了
if(x1 % (left*right) == 0)
cout << "Yes" << endl;
else cout << "No" << endl;
}
// cout << left << " " << right << endl;
}
return 0;
}