// Zadanie: Napisz program, ktory wypelni tablice tysiacem liczb pszeudolosowych z zakresu od 0 do 100. Nastepnie program policzy srednia z tych liczb, odchylenie standardowe sredniej oraz odchylenie standardowe pojedynczego pomiaru dla zadanej tablicy. #include #include #include using namespace std; int main(){ srand(time(0)); const int rozmiar = 1000; double tab[rozmiar]; for(int i = 0; i < rozmiar; i++){ tab[i] = rand()%100; } double suma = 0; for(int i = 0; i < rozmiar; i++){ suma += tab[i]; } double srednia = suma / rozmiar; double suma_kw = 0; for(int i = 0; i < rozmiar; i++){ double diff = srednia - tab[i]; suma_kw += diff * diff; } double sigma_poj = sqrt(suma_kw / (rozmiar - 1)); double sigma_sr = sigma_poj / sqrt(rozmiar); cout << "Srednia = " << srednia << endl; cout << "Odchylenie std. pojedynczego pomiaru = " << sigma_poj << endl; cout << "Odchylenie std. sredniej = " << sigma_sr << endl; return 0; }