#include <iostream>
#include <vector>

#include "histogram.h"
#include "text.h"
#include <curl/curl.h>




using namespace std;


struct Input { 
	// Создание структуры 
	vector <double> numbers;
	size_t bin_count{};
};

Input

input_data(istream& hin, bool promt = false) {
	// Функция ввода
	//Создание переменных

	size_t number_count;
	Input in;
	
	

	// Ввод переменных

	if (promt == true) {
		cerr << "Enter number count: " << endl;
	}

	hin >> number_count;

	in.numbers.resize(number_count);

	if (promt == true) {
		cerr << "Enter numbers: " << endl;
	}

	for (int i = 0; i < number_count; i++) {
		hin >> in.numbers[i];

	}
	if (promt == true) {
		cerr << "Enter bin count: " << endl;
	}

	hin >> in.bin_count;

	return in;
}






int main()
{
	curl_global_init(CURL_GLOBAL_ALL);


	string promt;
	bool promt1;

	cout << "DO YOU NEED CERR? (YES/NO)" << endl;

	while (true) {
		cin >> promt;
		if (promt == "YES") {
			promt1 = true;
			break;
		} else if (promt == "NO") {
			promt1 = false;
			break;
		} else {
			cout << "NORMALLY PLS: ";
		}
		cout << endl;
	}


	// Функция main 
	auto in = input_data(cin, promt1); // Ввод структуры
	auto bins = make_histogram(in.numbers, in.bin_count); // Распределние по корзинам
	show_histogram_svg(bins); // Вывод графика


	
	

	// Код

	






	return 0;
}