结果为double型的时候,分子,分母不能同时为int型的
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int n,m;
while(cin>>n>>m&&(n!=0||m!=0))
{
double t;
t=1.0*n*n-4.0*m;
if(t>=0)
{
double y;
y=(n+sqrt(t))/2.0;
int x=y;
if(x==y)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
else
cout<<"No"<<endl;
}
}