Beispiel #1
0
int main(){
	struct osoba tab[5];
	int i = 0;
	srand(time(NULL));
	for(i = 0; i < 5; i++){
		printf("Srednia nr: %d --> %lf\n", i, srednia(tab[i]));
	}
}
Beispiel #2
0
void algorytm::zapisz_do_csv(ofstream& out){
  ofstream tab_czas("wyjscie.csv");
  tab_czas<<"Proba [m],"<<"Czas"<<endl;
  for(int i =0; i<m; i++){
      tab_czas<<(i+1)<<","<<czas[i]<<endl;
  }
  float sr = srednia(czas,m);
  float odchylenie = odchylenie_standardowe(sr,czas,m);
  tab_czas<<"Srednia,"<<sr<<endl;
  tab_czas<<"Odchylenie,"<<odchylenie<<endl;
  zapisz_do_gnuplot(out,sr,odchylenie);

  
}
Beispiel #3
0
int main()
{
	double T[100] = {
		0.81472369, 0.90579194, 0.12698682, 0.91337586, 0.63235925, 0.09754040, 0.27849822,
		0.54688152, 0.95750684, 0.96488854, 0.15761308, 0.97059278, 0.95716695, 0.48537565,
		0.80028047, 0.14188634, 0.42176128, 0.91573553, 0.79220733, 0.95949243, 0.65574070,
		0.03571168, 0.84912931, 0.93399325, 0.67873515, 0.75774013, 0.74313247, 0.39222702,
		0.65547789, 0.17118669, 0.70604609, 0.03183285, 0.27692298, 0.04617139, 0.09713178,
		0.82345783, 0.69482862, 0.31709948, 0.95022205, 0.03444608, 0.43874436, 0.38155846,
		0.76551679, 0.79519990, 0.18687260, 0.48976440, 0.44558620, 0.64631301, 0.70936483,
		0.75468668, 0.27602508, 0.67970268, 0.65509800, 0.16261174, 0.11899768, 0.49836405,
		0.95974396, 0.34038573, 0.58526775, 0.22381194, 0.75126706, 0.25509512, 0.50595705,
		0.69907672, 0.89090325, 0.95929143, 0.54721553, 0.13862444, 0.14929401, 0.25750825,
		0.84071726, 0.25428218, 0.81428483, 0.24352497, 0.92926362, 0.34998377, 0.19659525,
		0.25108386, 0.61604468, 0.47328885, 0.35165951, 0.83082863, 0.58526409, 0.54972361,
		0.91719366, 0.28583902, 0.75720023, 0.75372909, 0.38044585, 0.56782164, 0.07585429,
		0.05395012, 0.53079755, 0.77916723, 0.93401068, 0.12990621, 0.56882366, 0.46939064,
		0.01190207, 0.33712264
	};

	printf("Srednia: %.4lf\n", srednia(T, 100));

	return 0;
}