#include #include #include #include "histogram.h" #include "text.h" #include "svg.h" using namespace std; struct Input { vector Numbers; size_t BinCount{}; }; Input InputData(istream& in, bool prompt) { Input inp; size_t NumberCount; if (prompt) { cerr << "Enter number count: "; } in >> NumberCount; if (prompt) { cerr << "Enter bin count: "; } in >> inp.BinCount; inp.Numbers.resize(NumberCount); for (int i = 0; i < NumberCount; i++) { in >> inp.Numbers[i]; } return inp; } void FindMinMax(const vector& Numbers, double& minn, double& maxx); vector MakeHistogram(vector Numbers, size_t BinCount, double& MaxCount); void ShowHistogrammText(vector Bins); int main() { double MaxCount = 0; Input in = InputData(cin, true); vector Bins(in.BinCount); Bins = MakeHistogram(in.Numbers, in.BinCount, MaxCount); ShowHistogramSvg(Bins); return 0; }