Expand|Select|Wrap|Line Numbers
- #include <cstdlib>
- #include <iostream>
- #include <cmath>
- #include <cfloat>
- using namespace std;
- int main(int argc, char *argv[])
- {double x1,x2,x3,u,o,g1,g2,g3,j1,j2,j3;
- x1=0;
- x2=3/2;
- x3=3;
- u=3/2;
- o=1/2;
- j1=x1-u;
- j2=x2-u;
- j3=x3-u;
- g1=((exp(0)/2*pow(o,2))/(o*sqrt(2*M_PI)));
- g2=(1/(o*sqrt(2*M_PI)))*exp(-pow(j2,2)/2*pow(o,2));
- g3=(1/(o*sqrt(2*M_PI)))*exp(-pow(j3,2)/2*pow(o,2));
- cout<< "for x equal to 0 the guassian ="<<g1<<endl;
- cout<< "for x equal to 1.5 the guassian ="<<g2<<endl;
- cout<< "for x equal to 3.0 the guassian ="<<g3<<endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }