Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab6_46

Snippet info

Language

Cpp

Visibility

public

Author

maloy-

Created

2018-11-23T19:45:54Z

Updated

2018-11-23T19:45:56Z

#include <iostream>
using namespace std;
#include <cmath>
int main() {
    cout << "Введите длину массива (N)" << endl ; 
    int n ; 
    cin >> n ; 
    cout << "ВВодите масив поелементно" << endl ; 
    int a[n];
    for ( int i = 0 ; i<=(n-1);i++){
        cin >> a[i] ; 
        
    }
    int sum = 0 ; 
    for ( int i = 0 ; i<=(n-1);i++){
        cout << i+1 <<  " = " << a[i] << endl ;  
        sum += a[i];
    }
    double sr ; 
    sr = sum / n ;
    int s[n];
    for (int i = 0 ; i<=(n-1) ; i++){
        s[i] = sqrt((pow((a[i]-sr),2))/(n-1));
        cout << "S-" << i+1 << " == " << s[i] << endl ; 
    }
    
    
    
    return 0;
}
INFO