upd: Откат до конца ЛР3
Этот коммит содержится в:
@@ -4,8 +4,6 @@
|
|||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -14,37 +12,26 @@ struct Input {
|
|||||||
size_t bin_count{};
|
size_t bin_count{};
|
||||||
};
|
};
|
||||||
|
|
||||||
Input input_data(istream& in_stream, bool prompt) {
|
Input input_data() {
|
||||||
Input in;
|
|
||||||
size_t number_count;
|
size_t number_count;
|
||||||
|
cerr << "Enter number count: ";
|
||||||
|
cin >> number_count;
|
||||||
|
|
||||||
if (prompt) {
|
Input in;
|
||||||
cerr << "Enter number count: ";
|
|
||||||
}
|
|
||||||
in_stream >> number_count;
|
|
||||||
|
|
||||||
in.numbers.resize(number_count);
|
in.numbers.resize(number_count);
|
||||||
if (prompt) {
|
cerr << "Enter " << number_count << " numbers: ";
|
||||||
cerr << "Enter " << number_count << " numbers: ";
|
|
||||||
}
|
|
||||||
for (size_t i = 0; i < number_count; i++) {
|
for (size_t i = 0; i < number_count; i++) {
|
||||||
in_stream >> in.numbers[i];
|
cin >> in.numbers[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prompt) {
|
cerr << "Enter bin count: ";
|
||||||
cerr << "Enter bin count: ";
|
cin >> in.bin_count;
|
||||||
}
|
|
||||||
in_stream >> in.bin_count;
|
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
auto in = input_data();
|
||||||
int main(int argc, char* argv[]) {
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
|
||||||
bool prompt = true;
|
|
||||||
auto in = input_data(cin, prompt);
|
|
||||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||||
show_histogram_svg(bins);
|
show_histogram_svg(bins);
|
||||||
show_histogram_text(bins);
|
show_histogram_text(bins);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user