|
|
@ -4,14 +4,12 @@
|
|
|
|
#include <sstream>
|
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t write_data(void* ptr, size_t size, size_t nmemb, std::stringstream* stream) {
|
|
|
|
size_t write_data(void* ptr, size_t size, size_t nmemb, std::stringstream* stream) {
|
|
|
|
size_t data_size = size * nmemb;
|
|
|
|
size_t data_size = size * nmemb;
|
|
|
|
stream->write(static_cast<const char*>(ptr), data_size);
|
|
|
|
stream->write(static_cast<const char*>(ptr), data_size);
|
|
|
|
return data_size;
|
|
|
|
return data_size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Input download(const std::string& url) {
|
|
|
|
Input download(const std::string& url) {
|
|
|
|
std::stringstream buffer;
|
|
|
|
std::stringstream buffer;
|
|
|
|
|
|
|
|
|
|
|
@ -40,11 +38,9 @@ int main(int argc, char* argv[]) {
|
|
|
|
|
|
|
|
|
|
|
|
Input input;
|
|
|
|
Input input;
|
|
|
|
if (argc > 1) {
|
|
|
|
if (argc > 1) {
|
|
|
|
std::cout << "Êîëè÷åñòâî àðãóìåíòîâ: " << argc << std::endl;
|
|
|
|
input = download(argv[1]);
|
|
|
|
for (int i = 0; i < argc; ++i) {
|
|
|
|
} else {
|
|
|
|
std::cout << "argv[" << i << "] = " << argv[i] << std::endl;
|
|
|
|
input = input_data(std::cin, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|