|  |  | @ -2,49 +2,33 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <vector> |  |  |  | #include <vector> | 
			
		
	
		
		
			
				
					
					|  |  |  | #include "histogram.h" |  |  |  | #include "histogram.h" | 
			
		
	
		
		
			
				
					
					|  |  |  | #include "text.h" |  |  |  | #include "text.h" | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <curl/curl.h> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | struct Input{ |  |  |  | struct Input{ | 
			
		
	
		
		
			
				
					
					|  |  |  |     std::vector<double> numbers; |  |  |  |     std::vector<double> numbers; | 
			
		
	
		
		
			
				
					
					|  |  |  |     size_t bin_count{}; |  |  |  |     size_t bin_count{}; | 
			
		
	
		
		
			
				
					
					|  |  |  | }; |  |  |  | }; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | Input input_data(std::istream& in, bool prompt) { |  |  |  | Input input_data() { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     size_t number_count; |  |  |  |     size_t number_count; | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (prompt) { |  |  |  |     std::cerr << "Enter number count: "; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter number count: "; |  |  |  |     std::cin >> number_count; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     in >> number_count; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (prompt) { |  |  |  |     std::cerr << "Enter numbers: \n"; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter numbers: \n"; |  |  |  |     Input in; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     in.numbers.resize(number_count); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     Input local; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     local.numbers.resize(number_count); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     for (size_t i = 0; i < number_count; ++i) { |  |  |  |     for (size_t i = 0; i < number_count; ++i) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         in >> local.numbers[i]; |  |  |  |         std::cin >> in.numbers[i]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (prompt) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter bucket: "; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     in >> local.bin_count; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     return local; |  |  |  |     std::cerr << "Enter bucket: "; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     std::cin >> in.bin_count; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return in; | 
			
		
	
		
		
			
				
					
					|  |  |  | }; |  |  |  | }; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | using namespace std; |  |  |  | using namespace std; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | int main(int argc, char* argv[]) { |  |  |  | int main() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (argc>1){ |  |  |  |     Input in = input_data(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         std::cout << "Êîëè÷åñòâî àðãóìåíòîâ (argc): " << argc << std::endl; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         for (int i = 0; i < argc; ++i) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             std::cout << "argv[" << i << "] = " << argv[i] << std::endl; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         return 0; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     curl_global_init(CURL_GLOBAL_ALL); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     Input in = input_data(cin, true); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     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); | 
			
		
	
		
		
			
				
					
					|  |  |  |     return 0; |  |  |  |     return 0; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |