итоговый вариант
Этот коммит содержится в:
12
main.cpp
12
main.cpp
@@ -6,9 +6,7 @@
|
||||
#include "svg.h"
|
||||
#include <curl/curl.h>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -38,8 +36,8 @@ input_data(istream& in, bool prompt = true){
|
||||
}
|
||||
if (prompt == true) {
|
||||
cerr << "Enter bin count \n";
|
||||
in >> iiin.bin_count;
|
||||
}
|
||||
in >> iiin.bin_count;
|
||||
return iiin;
|
||||
}
|
||||
|
||||
@@ -54,6 +52,7 @@ write_data(void* items, size_t item_size, size_t item_count, void* ctx) {
|
||||
|
||||
Input
|
||||
download(const string& address) {
|
||||
cerr << "zalupa ebanaya" << endl;
|
||||
stringstream buffer;
|
||||
|
||||
CURL* curl = curl_easy_init();
|
||||
@@ -69,16 +68,19 @@ download(const string& address) {
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
cerr << "polnaya pizda" << endl;
|
||||
cerr << buffer.str();
|
||||
return input_data(buffer, false);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
Input in;
|
||||
if (argc > 1) {
|
||||
cerr << "ebal rot"<< endl;
|
||||
in = download(argv[1]);
|
||||
}
|
||||
else {
|
||||
cerr << "kak je zaebalo"<<endl;
|
||||
in = input_data(cin, true);
|
||||
}
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
|
||||
Ссылка в новой задаче
Block a user