code:make_histogram_fixed_1[2]
Этот коммит содержится в:
24
main.cpp
24
main.cpp
@@ -4,18 +4,19 @@
|
||||
#include <cstdio>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void find_minmax(vector<double> numbers, double& min, double& max);
|
||||
size_t maxBin(vector<size_t> bins);
|
||||
|
||||
|
||||
const size_t SCREEN_WIDTH = 80;
|
||||
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
|
||||
struct Input {
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
};
|
||||
|
||||
void find_minmax(vector<double> numbers, double& min, double& max);
|
||||
//size_t maxBin(vector<size_t> bins);
|
||||
vector<size_t> make_histogram(vector<double> numbers, size_t bin_count);
|
||||
Input input_data();
|
||||
|
||||
const size_t SCREEN_WIDTH = 80;
|
||||
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
|
||||
|
||||
int main()
|
||||
{
|
||||
size_t maxCount;
|
||||
@@ -83,14 +84,14 @@ Input input_data() {
|
||||
size_t countOfNumbers;
|
||||
cerr << "Input your count of numbers:\n";
|
||||
cin >> countOfNumbers;
|
||||
cerr << "Input numbers:\n";
|
||||
|
||||
input_struct.numbers.resize(countOfNumbers);
|
||||
|
||||
cerr << "Input bin count:\n";
|
||||
cin >> input_struct.bin_count;
|
||||
|
||||
cerr << "Input numbers:\n";
|
||||
for (int i = 0; i < countOfNumbers; i++) {
|
||||
cerr << i << endl;
|
||||
cerr << i << ":"<< endl;
|
||||
cin >> input_struct.numbers[i];
|
||||
}
|
||||
cerr << endl;
|
||||
@@ -121,3 +122,6 @@ vector<size_t> make_histogram(vector<double> numbers, size_t bin_count)
|
||||
}
|
||||
return bins;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user