arg
Этот коммит содержится в:
36
lab01.layout
36
lab01.layout
@@ -2,24 +2,14 @@
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="text.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="13" zoom_2="0">
|
||||
<File name=".gitignore" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="15" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="69" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="histogram.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="16" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="175" topLine="0" />
|
||||
<Cursor1 position="19" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="main.cpp" open="1" top="1" tabpos="2" split="0" active="1" splitpos="0" zoom_1="15" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="909" topLine="23" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="svg.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="20" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="168" topLine="0" />
|
||||
<Cursor1 position="867" topLine="18" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="svg.cpp" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="17" zoom_2="0">
|
||||
@@ -27,19 +17,29 @@
|
||||
<Cursor1 position="18" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="histogram.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="16" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="175" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="histogram.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="17" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="566" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name=".gitignore" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="15" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="19" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="text.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="11" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="448" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="svg.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="20" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="168" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
<File name="text.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="13" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="69" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
||||
|
||||
23
main.cpp
23
main.cpp
@@ -18,17 +18,23 @@ struct Input {
|
||||
};
|
||||
|
||||
Input
|
||||
input_data(istream& in) {
|
||||
input_data(istream& in,bool prompt) {
|
||||
string a, b, c;
|
||||
if(prompt== true){
|
||||
a = "Enter number count:";
|
||||
b = "Enter numbers:";
|
||||
c = "Enter bin count:";
|
||||
}
|
||||
size_t number_count;
|
||||
cerr << "Enter number count: ";
|
||||
cerr << a;
|
||||
in >> number_count;
|
||||
|
||||
Input on;
|
||||
on.numbers.resize(number_count);
|
||||
for (size_t i = 0; i < number_count; i++) {
|
||||
cerr << "Enter number " << i+1 << ": ";
|
||||
cerr << b << i+1 << ": ";
|
||||
in >> on.numbers[i];}
|
||||
cerr << "Enter bin count: ";
|
||||
cerr << c;
|
||||
in >> on.bin_count;
|
||||
|
||||
on.n = 0;
|
||||
@@ -44,11 +50,16 @@ input_data(istream& in) {
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc > 1) {
|
||||
cerr << "argv[0] = " << argv[0] <<'\n';
|
||||
cerr << "argc = " << argc;
|
||||
return 0;}
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
auto in = input_data(cin);
|
||||
auto in = input_data(cin,true);
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
return 0;
|
||||
|
||||
Ссылка в новой задаче
Block a user