このエラーが発生しました:
エラー 1 エラー C2064: 項は 1 つの引数を取る関数として評価されません
オンライン:
discr=((pow(b, 2))-4(a*c));
二次式プログラムのコード:
#include "stdafx.h"
#include <iostream>
#include "math.h"
using namespace std;
float a, b, c, d,x1, x2, discr;
int ec2g(float a, float b, float c, float & x1, float & x2);
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"'a'"<<endl;
cin>>a;
cout<<"'b'"<<endl;
cin>>b;
cout<<"'c'"<<endl;
cin>>c;
if (ec2g(a, b, c, x1, x2)){
cout<<x1<<x2<<endl;
}
else{
cout<<"No solution"<<endl;
}
return 0;
}
int ec2g(float a, float b, float c, float & x1, float & x2){
int solreal=0;
discr=((pow(b, 2))-4(a*c));
if(discr>0.0){
solreal=1;
x1=(-b+sqrt(discr)/(2.0*a));
x2=(-b-sqrt(discr)/(2.0*a));
}
return solreal;
}
どうすればこれを修正できますか?