|
|
@ -4,6 +4,7 @@
|
|
|
|
#include "histogram.h"
|
|
|
|
#include "histogram.h"
|
|
|
|
#include "text.h"
|
|
|
|
#include "text.h"
|
|
|
|
#include "svg.h"
|
|
|
|
#include "svg.h"
|
|
|
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
using namespace std;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
struct Input{
|
|
|
|
struct Input{
|
|
|
@ -12,30 +13,47 @@ struct Input{
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Input
|
|
|
|
Input
|
|
|
|
input_data()
|
|
|
|
input_data(istream& in,bool promt)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (promt){
|
|
|
|
size_t count; // âñå ÷èñëà
|
|
|
|
size_t count; // âñå ÷èñëà
|
|
|
|
cerr << "Count= ";
|
|
|
|
cerr << "Count= ";
|
|
|
|
cin >> count;
|
|
|
|
cin >> count;
|
|
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
Input rez;
|
|
|
|
in.numbers.resize(count);
|
|
|
|
rez.numbers.resize(count);
|
|
|
|
cerr << "numbers:";
|
|
|
|
cerr << "numbers:";
|
|
|
|
for (size_t i = 0; i < count; i++)
|
|
|
|
for (size_t i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cin >> in.numbers[i];
|
|
|
|
cin >> rez.numbers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cerr << "Bin_count= ";
|
|
|
|
cerr << "Bin_count= ";
|
|
|
|
cin >> in.bin_count;
|
|
|
|
cin >> rez.bin_count;
|
|
|
|
|
|
|
|
return rez;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
size_t count; // âñå ÷èñëà
|
|
|
|
|
|
|
|
cin >> count;
|
|
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
Input rez;
|
|
|
|
|
|
|
|
rez.numbers.resize(count);
|
|
|
|
|
|
|
|
for (size_t i = 0; i < count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cin >> rez.numbers[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cin >> rez.bin_count;
|
|
|
|
|
|
|
|
return rez;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Input in = input_data();
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
|
|
|
bool promt=true;
|
|
|
|
|
|
|
|
Input in = input_data(cin, promt);
|
|
|
|
auto bins=make_histogram(in.numbers,in.bin_count);
|
|
|
|
auto bins=make_histogram(in.numbers,in.bin_count);
|
|
|
|
show_histogram_svg(bins); //,in.bin_count);
|
|
|
|
double sr = 0.0;
|
|
|
|
|
|
|
|
show_histogram_svg(bins,sr);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|