#include"iostream.h"
#include"math.h"
class cos
{
int du;
double c,x;
public:
cos(int dul)
{du=dul;
}
void hdu();
void process();
void print();
};
void cos::hdu()
{x=(du*3.1415926)/180;
}
void cos::process()
{
c=0;
double n,m,k,s=1;
for(n=0;m<10e-6;n=n+2)
{
for(k=1;k<=n;k++)
{s=k*s;
}
m=pow(x,n)/s;
c=c+m;
}
}
void cos::print()
{cout<<c<<endl;
}
main()
{
cos t1(90);
t1.process;
t1.print;
}
C:\Documents and Settings\Administrator\桌面\319_10.cpp(41) : error C2146: syntax error : missing ';' before identifier 't1'
C:\Documents and Settings\Administrator\桌面\319_10.cpp(41) : warning C4551: function call missing argument list
C:\Documents and Settings\Administrator\桌面\319_10.cpp(41) : error C2065: 't1' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\319_10.cpp(42) : error C2228: left of '.process' must have class/struct/union type
C:\Documents and Settings\Administrator\桌面\319_10.cpp(43) : error C2228: left of '.print' must have class/struct/union type
C:\Documents and Settings\Administrator\桌面\319_10.cpp(45) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.
错误多多
麻烦帮忙看看
守候你守候我
繁花如伊
潇湘沐
相关分类