Untitled

 avatar
unknown
c_cpp
a year ago
517 B
5
Indexable
#include <iostream>
#include <cmath>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
using std::string;
using namespace std;

int main(){
    int n, x;
    cin >> n;
    cout << fixed;
    cout.precision(8);
    const double pi = std::acos(-1.0);
    const double k = (1.0/(sqrt(2*pi)));
    for(int i = 0; i < n; ++i){
        cin >> x;
        double k2 = exp((-0.5)*x*x);
        cout << k*k2;
        if(i != n-1)
            cout << endl;
    }
    return 0;
}
Editor is loading...
Leave a Comment