Сравнить коммиты

...

5 Коммитов

@ -2,6 +2,7 @@
#include <math.h>
#include <iostream>
#include <conio.h>
#include <curl/curl.h>
#include "histogram.h"
#include "text.h"
#include "svg.h"
@ -11,19 +12,44 @@ struct Input {
size_t bin_count{};
};
Input
input_data(){
input_data(istream& in, bool prompt){
cerr << "Do you need hints? Type 0 for no, 1 for yes: ";
int ans;
int state = 0;
while (state ==0){
in >> ans;
if (ans==1) {prompt = true; state=1;}
else if (ans==0) {prompt = false; state=1;}
else cerr << "Invalid data. Please type only 0 or 1: ";
}
size_t number_count;
cin >> number_count;
Input in;
in.numbers.resize(number_count);
if (prompt == true) cerr << "Enter number count: ";
in >> number_count;
Input input;
input.numbers.resize(number_count);
if (prompt == true) cerr << "Enter numbers: ";
for (size_t i = 0; i < number_count; i++){
cin >> in.numbers[i];
in >> input.numbers[i];
}
cin >> in.bin_count;
return in;
if (prompt == true) cerr << "Enter bin count: ";
in >> input.bin_count;
return input;
}
int main(){
auto in = input_data();
int main(int argc, char* argv[]){
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 != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
return 0;
curl_global_init(CURL_GLOBAL_ALL);
}
bool prompt;
auto in = input_data(cin, prompt);
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins);
}

Загрузка…
Отмена
Сохранить