判断这个偶数长度的数平分长度后再乘起来能否被原数整除
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
int main()
{
int t;
ll n;
ios::sync_with_stdio(0);
cin>>t;
while(t--)
{
bool f=0;
cin>>n;
int len=0;
int tmp = n;
while(tmp){
tmp/=10;
len++;
}
int a;
a = n%((int)pow(10,len/2));
tmp = n/((int)pow(10,len/2));
if(a!=0&&n%a==0){
n/=a;
if(tmp!=0&&n%tmp==0)f=1;
}
if(f)puts("Yes");
else puts("No");
}
return 0;
}
开始写的时候碰到了浮点错误
原来是出现了除以0的情况
注意取余除法 还有 数据溢出导致除0的情况