C:\Users\磊\Desktop\Cpp1.cpp(23) : error C2628: 'A' followed by 'int' is illegal (did you forget a ';'?)
C:\Users\磊\Desktop\Cpp1.cpp(31) : warning C4508: 'main' : function should return a value; 'void' return type assumed
执行 cl.exe 时出错.
#include
#include
using namespace std;
class A
{
public:
double x,y;
void get_x()
{
cout>x;
}
double put_y()
{
double sh( double x )
{ return ( exp( t )-exp( -t ) )/2; }//1
y = sh( 1+sh(x) )/( sh( 2*x )+sh( 3*x ) );
return y;
}
}
int main()
{A a;
double x;
a.get_x();
cin>>x;
a.put_y();
}
class A
{
};
需要这样
int main()之前缺少};