Dateien nach „BSP_1_B“ hochladen
This commit is contained in:
parent
97a7a2432d
commit
a4c502fc4d
5 changed files with 702 additions and 0 deletions
32
BSP_1_B/main.cpp
Normal file
32
BSP_1_B/main.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "bsp_1_b.h"
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
// BSP 1_B
|
||||
|
||||
int main()
|
||||
{
|
||||
const string name1("data_1.txt"); // name of input file
|
||||
const string name2("out.txt"); // name of output file
|
||||
vector<short int> v;
|
||||
|
||||
read_vector_from_file(name1, v);
|
||||
|
||||
float a, g, h, d, minv, maxv;
|
||||
meandevvec(v,a,g,h,d);
|
||||
minv = *min_element(v.begin(),v.end());
|
||||
maxv = *max_element(v.begin(),v.end());
|
||||
|
||||
cout << "Auswertung" << endl;
|
||||
cout << "arithmetisches Mittel: " << a << endl;
|
||||
cout << "geometrisches Mittel: " << g << endl;
|
||||
cout << "harmonisches Mittel: " << h << endl;
|
||||
cout << "deviation/Standardabweichung: " << d << endl;
|
||||
cout << "Minimum: " << minv << endl;
|
||||
cout << "Maximum: " << maxv << endl;
|
||||
|
||||
vector<float> ve{a,g,h,d,minv,maxv};
|
||||
write_vector_to_file(name2, ve);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue