#include #include #include "histogram.h" #include "svg.h" #include "text.h" #include using namespace std; //const size_t SCREEN_WIDTH = 80; //const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1; struct Input { vector numbers; size_t bin_count{}; size_t IMAGE_WIDTH{}; }; Input input_data(istream& in, bool promt) { size_t number_count, bin_count, IMAGE_WIDTH; if (promt) cerr << "Enter number count: "; in >> number_count; Input input; if (promt) cerr << " Input width of image, > 70 but not >800 : "; in >> input.IMAGE_WIDTH; if(input.IMAGE_WIDTH < 70 || input.IMAGE_WIDTH > 800 ) { while(input.IMAGE_WIDTH < 70 || input.IMAGE_WIDTH > 800) { if (promt) cerr << " Input width of image, >70 but not >800 : "; in >> input.IMAGE_WIDTH; } } //size_t number_count = in.number_counts; input.numbers.resize( number_count ); if (promt) cerr << "Enter numbers: "; // vector numbers(number_count); for (size_t i = 0; i < number_count; i++) { in >> input.numbers[i]; } if (promt) cerr << "Count of baskets: "; in >> input.bin_count; return input; } int main(int argc, char* argv[]) { if( argc > 1 ){ CURL* curl = curl_easy_init(); cout << argc << '\n'; //while (true) for (int i = 0; i < argc; i++){ cout << argv[i] << " "; } cout << endl; curl_easy_cleanup(curl); return 0; } curl_global_init(CURL_GLOBAL_ALL); auto input = input_data(cin, true); auto bins = make_histogram( input.numbers, input.bin_count ); //int chek_block_width(in.IMAGE_WIDTH); //chek_block_width(in.IMAGE_WIDTH, in.number_count); //if (chek_block_width==1) show_histogram_svg( bins, input.IMAGE_WIDTH ); //if(chek_block_width==0) return 0; //show_histogram_svg(bins); }