请问错误是怎么回事
源代码是:程序代码:
#include<iostream> #include <iomanip> #include <math.h> using namespace std; class sanjiaoxing { private: double x,y,z; public: void shuru(double a,double b,double c); void mianji(); void chouchang(); }; void sanjiaoxing::shuru(double a,double b,double c) { x=a; y=b; z=c; } void sanjiaoxing::chouchang() { cout<<x+y+z<<endl; } void sanjiaoxing::mianji() { int d,e,f,g; d=1/(2*(x+y+z)); e=sqrt(d*(d-x)*(d-y)*(d-z)); cout<<g<<endl; } void main() { sanjiaoxing 1;//error C2143: syntax error : missing ';' before 'constant' int a,b,c,i; cin>>a>>b>>c; 1.shuru(a,b,c);//error C2059: syntax error : 'bad suffix on number'error C2146: syntax error : missing ';' before identifier 'shuru'还有个shuru未定义 1.chouchang();//和上行差不多的错误提示 1.mianji();//和上行差不多的错误提示 }
[ 本帖最后由 a99875984 于 2012-5-31 15:21 编辑 ]