#include <iostream>
int main()
{
int v1=0;
double x[100]={0.01};
long double sinx=x[v1];
for(int g=1,g<=10,g++)
{
int a=1;
double b=1;
double c=x[g];
for(int h=1,h<=g,vh++)
{
a=a*(-1);
b=b/(2*h*(2*h+1));
c=c*x[v1]*x[v1];
}
sinx+=a*b*c;
}
std::cout<<sinx;
std::cin>>x[2];
return 0;
}
--------------------Configuration: 12345123 - Win32 Debug--------------------
Compiling...
12345123.cpp
D:\Backup\我的文档\12345123.cpp(7) : error C2143: syntax error : missing ',' before '<='
D:\Backup\我的文档\12345123.cpp(7) : error C2086: 'g' : redefinition
D:\Backup\我的文档\12345123.cpp(7) : error C2059: syntax error : '<='
D:\Backup\我的文档\12345123.cpp(8) : error C2143: syntax error : missing ';' before '{'
D:\Backup\我的文档\12345123.cpp(12) : error C2143: syntax error : missing ',' before '<='
D:\Backup\我的文档\12345123.cpp(12) : error C2086: 'h' : redefinition
D:\Backup\我的文档\12345123.cpp(12) : error C2059: syntax error : '<='
D:\Backup\我的文档\12345123.cpp(13) : error C2143: syntax error : missing ';' before '{'
执行 cl.exe 时出错.
12345123.exe - 1 error(s), 0 warning(s)