VinogradovMA 2 месяцев назад
Родитель c7252e212a
Сommit 30a95a6811

@ -17,7 +17,7 @@ int main()
Input in = input_data();
std::vector<size_t> bins = make_histogram(in.numbers, in.bin_count);
show_histogram_text(bins, in.bin_count);
show_histogram_svg(bins);
return 0;
}
Input input_data() {
@ -27,15 +27,14 @@ Input input_data() {
cin >> countOfNumbers;
input_struct.numbers.resize(countOfNumbers);
cerr << "Input bin count:\n";
cin >> input_struct.bin_count;
cerr << "Input numbers:\n";
for (int i = 0; i < countOfNumbers; i++) {
cerr << i << ":" << endl;
cin >> input_struct.numbers[i];
}
cerr << endl;
cerr << "Input bin count:\n";
cin >> input_struct.bin_count;
return input_struct;
}

@ -14,5 +14,9 @@ void svg_end() {
void show_histogram_svg(const std::vector<size_t>& bins) {
svg_begin(400, 300);
svg_text(20, 20, std::to_string(bins[0]));
svg_end();
}
void svg_text(double left, double baseline, std::string text) {
std::cout << "<text x='" << left << "' y='35'>anything you want</text>";
}

@ -6,5 +6,6 @@
void svg_begin(double width, double height);
void svg_end();
void show_histogram_svg(const std::vector<size_t>& bins);
void svg_text(double left, double baseline, std::string text);
#endif // SVG_H_INCLUDED

Загрузка…
Отмена
Сохранить