Lubov (IlintsevaLv) 2 лет назад
Родитель db1e4cbf09
Сommit a48a92531a

@ -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,31 +13,47 @@ struct Input{
}; };
Input Input
input_data(istream& in) input_data(istream& in,bool promt)
{ {
size_t count; // âñå ÷èñëà if (promt){
cerr << "Count= "; size_t count; // âñå ÷èñëà
cin >> count; cerr << "Count= ";
cin >> count;
Input rez; Input rez;
rez.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 >> rez.numbers[i]; cin >> rez.numbers[i];
} }
cerr << "Bin_count= "; cerr << "Bin_count= ";
cin >> rez.bin_count; cin >> rez.bin_count;
return rez;
}
else{
size_t count; // âñå ÷èñëà
cin >> count;
return rez; 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(cin); 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);
double ttt = 0.0; double sr = 0.0;
show_histogram_svg(bins,ttt); show_histogram_svg(bins,sr);
return 0; return 0;
} }

Загрузка…
Отмена
Сохранить