|  |  | @ -4,6 +4,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | #include "text.h" |  |  |  | #include "text.h" | 
			
		
	
		
		
			
				
					
					|  |  |  | #include "svg.h" |  |  |  | #include "svg.h" | 
			
		
	
		
		
			
				
					
					|  |  |  | #include <string> |  |  |  | #include <string> | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | #include <curl/curl.h> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | using namespace std; |  |  |  | using namespace std; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -15,28 +16,50 @@ struct Input { | 
			
		
	
		
		
			
				
					
					|  |  |  | }; |  |  |  | }; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | Input |  |  |  | Input | 
			
		
	
		
		
			
				
					
					|  |  |  | input_data(istream& Newcin) { |  |  |  | input_data(istream& Newcin){ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     size_t number_count; |  |  |  |     size_t number_count; | 
			
		
	
		
		
			
				
					
					|  |  |  |     cerr << "Enter number count: "; |  |  |  |     cerr << "Enter number count: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     cin >> number_count; |  |  |  |     Newcin >> number_count; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     bool prompt; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     cerr << "Do you want any prompts? Enter 'true' if yes, 'false' if no: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     Newcin >> prompt; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if (prompt){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         cerr << "Prompt"; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     Input in; |  |  |  |     Input in; | 
			
		
	
		
		
			
				
					
					|  |  |  |     in.numbers.resize(number_count); |  |  |  |     in.numbers.resize(number_count); | 
			
		
	
		
		
			
				
					
					|  |  |  |     cerr << "Enter numbers: "; |  |  |  |     cerr << "Enter numbers: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     for (size_t i = 0; i < number_count; i++) { |  |  |  |     for (size_t i = 0; i < number_count; i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         cin >> in.numbers[i]; |  |  |  |         Newcin >> in.numbers[i]; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |     cerr << "Enter bin count: "; |  |  |  |     cerr << "Enter bin count: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     cin >> in.bin_count; |  |  |  |     Newcin >> in.bin_count; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     cerr << "Enter stroke in format RGB: "; |  |  |  |     cerr << "Enter stroke in format RGB: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     cin >> in.stroke; |  |  |  |     Newcin >> in.stroke; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     cerr << "Enter fill in format RGB: "; |  |  |  |     cerr << "Enter fill in format RGB: "; | 
			
		
	
		
		
			
				
					
					|  |  |  |     cin >> in.fill; |  |  |  |     Newcin >> in.fill; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     return in; |  |  |  |     return in; | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | int |  |  |  | int | 
			
		
	
		
		
			
				
					
					|  |  |  | main() { |  |  |  | main(int argc, char* argv[]) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | auto in = input_data(cin); |  |  |  |     if (argc > 1) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         CURL *curl = curl_easy_init(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if(curl) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             CURLcode res; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             curl_easy_setopt(curl, CURLOPT_URL, argv[1]); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             res = curl_easy_perform(curl); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (res != 0){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 cout << curl_easy_strerror(res); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 exit(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             curl_easy_cleanup(curl); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     curl_global_init(CURL_GLOBAL_ALL); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     auto in = input_data(cin); | 
			
		
	
		
		
			
				
					
					|  |  |  |     auto bins = make_histogram(in.numbers, in.bin_count); |  |  |  |     auto bins = make_histogram(in.numbers, in.bin_count); | 
			
		
	
		
		
			
				
					
					|  |  |  |     show_histogram_svg(bins, in.stroke, in.fill); |  |  |  |     show_histogram_svg(bins, in.stroke, in.fill); | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |