code: добавлен поток
Этот коммит содержится в:
@@ -32,7 +32,14 @@
|
|||||||
<Add option="-Wall" />
|
<Add option="-Wall" />
|
||||||
<Add option="-fexceptions" />
|
<Add option="-fexceptions" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
|
<Unit filename="histogram.cpp" />
|
||||||
|
<Unit filename="histogram.h" />
|
||||||
|
<Unit filename="histogram_internal.h" />
|
||||||
<Unit filename="main.cpp" />
|
<Unit filename="main.cpp" />
|
||||||
|
<Unit filename="svg.cpp" />
|
||||||
|
<Unit filename="svg.h" />
|
||||||
|
<Unit filename="text.cpp" />
|
||||||
|
<Unit filename="text.h" />
|
||||||
<Extensions>
|
<Extensions>
|
||||||
<lib_finder disable_auto="1" />
|
<lib_finder disable_auto="1" />
|
||||||
</Extensions>
|
</Extensions>
|
||||||
|
|||||||
16
main.cpp
16
main.cpp
@@ -10,20 +10,20 @@ struct Input {
|
|||||||
size_t bin_count{};
|
size_t bin_count{};
|
||||||
};
|
};
|
||||||
Input
|
Input
|
||||||
input_data(){
|
input_data(istream& in){
|
||||||
size_t number_count, bin_count;
|
size_t number_count;
|
||||||
cerr << "Enter number count: ";
|
cerr << "Enter number count: ";
|
||||||
cin >> number_count;
|
cin >> 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 Num[" << i << "]: ";
|
cerr << "Enter Num[" << i << "]: ";
|
||||||
cin >> in.numbers[i];
|
cin >> inp.numbers[i];
|
||||||
}
|
}
|
||||||
cerr << "Enter bin count: ";
|
cerr << "Enter bin count: ";
|
||||||
cin >> in.bin_count;
|
cin >> inp.bin_count;
|
||||||
return in;
|
return inp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ input_data(){
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
auto in = input_data();
|
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);
|
show_histogram_svg(bins);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,12 @@
|
|||||||
<Compiler>
|
<Compiler>
|
||||||
<Add option="-Wall" />
|
<Add option="-Wall" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
|
<Unit filename="doctest.h" />
|
||||||
|
<Unit filename="histogram.cpp" />
|
||||||
|
<Unit filename="histogram_internal.h" />
|
||||||
|
<Unit filename="svg.cpp" />
|
||||||
|
<Unit filename="svg.h" />
|
||||||
|
<Unit filename="unittest.cpp" />
|
||||||
<Extensions />
|
<Extensions />
|
||||||
</Project>
|
</Project>
|
||||||
</CodeBlocks_project_file>
|
</CodeBlocks_project_file>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user