|  |  | @ -2,17 +2,17 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | #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(istream& in, bool prompt) { |  |  |  | Input input_data(std::istream& in, bool prompt) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     size_t number_count; |  |  |  |     size_t number_count; | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (prompt){ |  |  |  |     if (prompt) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |          |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter number count: "; |  |  |  |         std::cerr << "Enter number count: "; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     in >> number_count; |  |  |  |     in >> number_count; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -20,14 +20,13 @@ Input input_data(istream& in, bool prompt) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter numbers: \n"; |  |  |  |         std::cerr << "Enter numbers: \n"; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     Input local; |  |  |  |     Input local; | 
			
		
	
		
		
			
				
					
					|  |  |  |     in.numbers.resize(number_count); |  |  |  |     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]; |  |  |  |         in >> local.numbers[i]; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (prompt) { |  |  |  |     if (prompt) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         std::cerr << "Enter bucket: "; |  |  |  |         std::cerr << "Enter bucket: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     in >> local.bin_count; |  |  |  |     in >> local.bin_count; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     return local; |  |  |  |     return local; | 
			
		
	
	
		
		
			
				
					|  |  | @ -36,6 +35,7 @@ Input input_data(istream& in, bool prompt) { | 
			
		
	
		
		
			
				
					
					|  |  |  | using namespace std; |  |  |  | using namespace std; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | int main() { |  |  |  | int main() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     curl_global_init(CURL_GLOBAL_ALL); | 
			
		
	
		
		
			
				
					
					|  |  |  |     Input in = input_data(cin, true); |  |  |  |     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); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |