幫我看看吧
好像跟DOUBLE 跟INT有關
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a;
double b=sqrt(a);
double c=2;
cin>>a;
if(a==2)
{cout<<"質數";}
else if((a!=c)&&(a%c)==0)
{cout<<"非質數";}
else
{
if(a%b==0)
{
cout<<"非質數";
}
else
{
for(int i=3;i<floor(b);i+=2)
{
if(0a%i==0)
{cout<<"非質數";
break;
}
}
}
}
else
{
cout<<"質數";
}
system("pause");
return 0;
}