Сравнить коммиты
2 Коммитов
3145fd865b
...
db7a473cdc
| Автор | SHA1 | Дата | |
|---|---|---|---|
| db7a473cdc | |||
| b03befd0f9 |
@@ -74,15 +74,15 @@
|
||||
1745611606 c:\users\ïëàòîí\desktop\project\lab01\histogram_internal.h
|
||||
<vector>
|
||||
|
||||
1746093073 source:c:\users\ïëàòîí\desktop\project\lab01\histogram.cpp
|
||||
1747659893 source:c:\users\ïëàòîí\desktop\project\lab01\histogram.cpp
|
||||
<iostream>
|
||||
<vector>
|
||||
"histogram.h"
|
||||
|
||||
1746094194 c:\users\ïëàòîí\desktop\project\lab01\svg.h
|
||||
1747659893 c:\users\ïëàòîí\desktop\project\lab01\svg.h
|
||||
<vector>
|
||||
|
||||
1746094194 source:c:\users\ïëàòîí\desktop\project\lab01\svg.cpp
|
||||
1747659893 source:c:\users\ïëàòîí\desktop\project\lab01\svg.cpp
|
||||
<math.h>
|
||||
<iostream>
|
||||
<conio.h>
|
||||
|
||||
20
main.cpp
20
main.cpp
@@ -12,24 +12,26 @@ struct Input {
|
||||
};
|
||||
|
||||
Input
|
||||
input_data() {
|
||||
size_t number_count, bin_count;
|
||||
input_data(istream& in, bool prompt){
|
||||
size_t number_count;
|
||||
cerr << "Enter number count: ";
|
||||
cin >> number_count;
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
Input inp;
|
||||
inp.numbers.resize(number_count);
|
||||
for (size_t i = 0; i < number_count; i++)
|
||||
{
|
||||
cerr << "Enter Num[" << i << "]: ";
|
||||
cin >> in.numbers[i];
|
||||
cin >> inp.numbers[i];
|
||||
}
|
||||
cerr << "Enter bin count: ";
|
||||
cin >> in.bin_count;
|
||||
return in;
|
||||
if (prompt) {
|
||||
cerr << "Enter bin count: ";
|
||||
}
|
||||
cin >> inp.bin_count;
|
||||
return inp;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
auto in = input_data();
|
||||
auto in = input_data(cin, true);;
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user