Сравнить коммиты
2 Коммитов
94f225210f
...
master
| Автор | SHA1 | Дата | |
|---|---|---|---|
| a48a92531a | |||
| db1e4cbf09 |
50
main.cpp
50
main.cpp
@@ -4,6 +4,7 @@
|
||||
#include "histogram.h"
|
||||
#include "text.h"
|
||||
#include "svg.h"
|
||||
#include <curl/curl.h>
|
||||
using namespace std;
|
||||
|
||||
struct Input{
|
||||
@@ -12,30 +13,47 @@ struct Input{
|
||||
};
|
||||
|
||||
Input
|
||||
input_data()
|
||||
input_data(istream& in,bool promt)
|
||||
{
|
||||
size_t count; // âñå ÷èñëà
|
||||
cerr << "Count= ";
|
||||
cin >> count;
|
||||
if (promt){
|
||||
size_t count; // âñå ÷èñëà
|
||||
cerr << "Count= ";
|
||||
cin >> count;
|
||||
|
||||
Input in;
|
||||
in.numbers.resize(count);
|
||||
cerr << "numbers:";
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
cin >> in.numbers[i];
|
||||
Input rez;
|
||||
rez.numbers.resize(count);
|
||||
cerr << "numbers:";
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
cin >> rez.numbers[i];
|
||||
}
|
||||
|
||||
cerr << "Bin_count= ";
|
||||
cin >> rez.bin_count;
|
||||
return rez;
|
||||
}
|
||||
else{
|
||||
size_t count; // âñå ÷èñëà
|
||||
cin >> count;
|
||||
|
||||
cerr << "Bin_count= ";
|
||||
cin >> in.bin_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()
|
||||
{
|
||||
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);
|
||||
show_histogram_svg(bins); //,in.bin_count);
|
||||
double sr = 0.0;
|
||||
show_histogram_svg(bins,sr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user