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

...

2 Коммитов

Автор SHA1 Сообщение Дата
KireevYP 5bd52d8465 code: prompt
12 месяцев назад
KireevYP 87617b312f code: параметр in
12 месяцев назад

@ -33,12 +33,14 @@
<Add option="-fexceptions" /> <Add option="-fexceptions" />
</Compiler> </Compiler>
<Unit filename="histogram.cpp" /> <Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="main.cpp" /> <Unit filename="main.cpp" />
<Unit filename="svg.cpp" /> <Unit filename="svg.cpp" />
<Unit filename="svg.h"> <Unit filename="svg.h">
<Option target="&lt;{~None~}&gt;" /> <Option target="&lt;{~None~}&gt;" />
</Unit> </Unit>
<Unit filename="text.cpp" /> <Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions> <Extensions>
<lib_finder disable_auto="1" /> <lib_finder disable_auto="1" />
</Extensions> </Extensions>

@ -11,30 +11,31 @@ struct Input {
}; };
Input Input
input_data() { 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 in1;
in.numbers.resize(number_count); in1.numbers.resize(number_count);
cerr << "Enter numbers: "; if (prompt) {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]; in >> in1.numbers[i];
} }
cerr << "Enter bin count: "; if (prompt) {cerr << "Enter bin count: ";}
cin >> in.bin_count; in >> in1.bin_count;
return in; return in1;
} }
int main() int main()
{ {
const size_t SCREEN_WIDTH = 80; const size_t SCREEN_WIDTH = 80;
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1; const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
bool prompt = true;
auto in = input_data(); 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;

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