谁来帮我找一下bug
我的代码是如下,他总是说我unexpect end of file,谁来帮我编译一下,看看问题出在哪 谢谢了
#include <iostream.h>
#include <math.h>
class equation
{
public:
void twoRealAnswer(int a,int b,int c);
void oneRealAnswer(int a,int b,int c);
void twoUnrealAnswer(int a,int b,int c);
private:
float a,b,c;
float realsection,unrealsection;
}
class equation::twoRealAnswer(int a,int b,int c)
{
realsection=-b/2*a;
unrealsection=sqrt((b*b-4*a*c)/2*a);
}
class equation::oneRealAnswer(int a,int b,int c)
{
realsection=-b/2*a;
unrealsection=0;
}
class equation::twoUnrealAnswer(int a,int b,int c)
{
realsection=-b/2*a;
unrealsection=sqrt((4*a*c-b*b)/2*a);
}
void main()
{
equation A;
cout<<"input the argument of a,b,c:";
cin>>A.a>>A.b>>A.c;
if ((A.b*A.b-4*A.c*A.a)>0)
{
A.twoRealAnswer(int a,int b,int c);
cout<<"answer1="<<A.realsection+A.unrealsection<<endl;
cout<<"answer2="<<A.realsection-A.unrealsection<<endl;
}
else if((A.b*A.b-4*A.c*A.a)==0)
{
A.oneRealAnswer(int a,int b,int c);
cout<<"answer="<<A.realsection+A.unrealsection<<endl;
}
else if((A.b*A.b-4*A.c*A.a)<0)
{
A.twoUnrealAnswer(int a,int b,int c);
cout<<"answer1="<<A.realsection<<"+"<<A.unrealsection<<"i"<<endl;
cout<<"answer2="<<A.realsection<<"+"<<A.unrealsection<<"i"<<endl;
}
}