Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
68 строки
1.1 KiB
C++
68 строки
1.1 KiB
C++
#include <iostream>
|
|
#include <vector>
|
|
#include <math.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <curl/curl.h>
|
|
#include "histogram.h"
|
|
#include "text.h"
|
|
#include "svg.h"
|
|
|
|
using namespace std;
|
|
|
|
struct Input {
|
|
vector<double>A;
|
|
size_t bin{};
|
|
};
|
|
|
|
Input
|
|
input_data(istream& tin, bool promt)
|
|
{
|
|
size_t n;
|
|
if (promt)
|
|
cerr<<"Marks: ";
|
|
tin>>n;
|
|
|
|
Input in;
|
|
in.A.resize(n);
|
|
for (size_t i=0; i<n; i++)
|
|
{
|
|
cerr<<"A["<<i<<"]=";
|
|
cin>>in.A[i];
|
|
}
|
|
|
|
if (promt)
|
|
cerr<<"Rows: ";
|
|
tin>>in.bin;
|
|
return in;
|
|
}
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
|
|
if (argc > 1)
|
|
{
|
|
CURL* curl = curl_easy_init();
|
|
if(curl)
|
|
{
|
|
CURLcode res;
|
|
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
|
res = curl_easy_perform(curl);
|
|
if (res != 0)
|
|
{
|
|
cout << curl_easy_strerror(res);
|
|
exit(1);
|
|
}
|
|
|
|
}
|
|
return 0;
|
|
}
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
auto in = input_data(cin, false);
|
|
auto B = make_histogram(in.A, in.bin);
|
|
show_histogram_svg (B);
|
|
|
|
system("pause");
|
|
return 0;
|
|
}
|