code:Функция ввода данных

main
PARZIVAL (BreganIM) 7 месяцев назад
Родитель 6bca2e79c8
Сommit 0f36d27913

@ -1,14 +1,34 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
using namespace std;
const size_t SCREEN_WIDTH = 80;
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
struct Input { struct Input {
vector<double> numbers; vector<double> numbers;
size_t bin_count{}; size_t bin_count{};
}; };
using namespace std; Input input_data() {
size_t number_count;
cout << "Enter number count: ";
cin >> number_count;
Input in;
in.numbers.resize(number_count);
cout << "Enter " << number_count << " numbers: ";
for (size_t i = 0; i < number_count; i++) {
cin >> in.numbers[i];
}
cout << "Enter bin count: ";
cin >> in.bin_count;
return in;
}
const size_t SCREEN_WIDTH = 80;
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
int main() int main()
{ {

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