注意:
要记得赋初值
#include<iostream>
#include<string>
using namespace std;
int main(){
int n,x;
cin>>n;
string str;
for(int i=0;i<n;i++){
cin>>str;
int a=0,b=0,sum=0;
for(int i=0;i< str.size()/2;i++){
a = a*10 + (str[i]-'0');
sum = sum *10 + (str[i]-'0');
}
for(int i=str.size()/2;i<str.size();i++){
b = b*10 + str[i]-'0';
sum = sum *10 + (str[i]-'0');
}
// printf("sum = %d, a = %d, b = %d\n",sum,a,b);
if(a*b==0) printf("No\n");
else if(sum%(a*b)==0) printf("Yes\n");
else printf("No\n");
}
return 0;
}