code:поток,prompt
Этот коммит содержится в:
Двоичные данные
lab_3.xcodeproj/project.xcworkspace/xcuserdata/lesaminov.xcuserdatad/UserInterfaceState.xcuserstate
сгенерированный
Двоичные данные
lab_3.xcodeproj/project.xcworkspace/xcuserdata/lesaminov.xcuserdatad/UserInterfaceState.xcuserstate
сгенерированный
Двоичный файл не отображается.
25
main.cpp
25
main.cpp
@@ -4,6 +4,7 @@
|
|||||||
#include "histogram.hpp"
|
#include "histogram.hpp"
|
||||||
#include "text.hpp"
|
#include "text.hpp"
|
||||||
#include "svg.hpp"
|
#include "svg.hpp"
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -13,26 +14,28 @@ struct Input
|
|||||||
size_t bin_count{};
|
size_t bin_count{};
|
||||||
};
|
};
|
||||||
|
|
||||||
Input input_data()
|
Input input_data(istream& in, bool prompt)
|
||||||
{
|
{
|
||||||
size_t number_count;
|
size_t number_count;
|
||||||
cerr << "Enter number count: ";
|
if (prompt) {cerr << "Enter number count: ";}
|
||||||
cin >> number_count; // Кол-во чисел
|
in >> number_count; // Кол-во чисел
|
||||||
Input in;
|
Input inp;
|
||||||
in.numbers.resize(number_count);
|
inp.numbers.resize(number_count);
|
||||||
for (size_t i = 0; i < number_count; i++)
|
for (size_t i = 0; i < number_count; i++)
|
||||||
{
|
{
|
||||||
cerr << "Enter number №" << i+1 << ": ";
|
if(prompt){cerr << "Enter number №" << i+1 << ": ";}
|
||||||
cin >> in.numbers[i];
|
in >> inp.numbers[i];
|
||||||
}
|
}
|
||||||
cerr << "Enter bin count: ";
|
if(prompt){cerr << "Enter bin count: ";}
|
||||||
cin >> in.bin_count;
|
in >> inp.bin_count;
|
||||||
return in;
|
return inp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
auto in = input_data();
|
// curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
bool prompt = false;
|
||||||
|
auto in = input_data(cin, prompt);
|
||||||
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;
|
||||||
|
|||||||
Двоичные данные
unittest/unittest.xcodeproj/project.xcworkspace/xcuserdata/lesaminov.xcuserdatad/UserInterfaceState.xcuserstate
сгенерированный
Двоичные данные
unittest/unittest.xcodeproj/project.xcworkspace/xcuserdata/lesaminov.xcuserdatad/UserInterfaceState.xcuserstate
сгенерированный
Двоичный файл не отображается.
Ссылка в новой задаче
Block a user