From b03befd0f92cf3bf2a7a2c67f7ae944d78a3ea67 Mon Sep 17 00:00:00 2001 From: "Platon (MiachinPY)" Date: Mon, 19 May 2025 16:16:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=82=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab01.depend | 6 +++--- main.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lab01.depend b/lab01.depend index 9be2205..b2cfa42 100644 --- a/lab01.depend +++ b/lab01.depend @@ -74,15 +74,15 @@ 1745611606 c:\users\платон\desktop\project\lab01\histogram_internal.h -1746093073 source:c:\users\платон\desktop\project\lab01\histogram.cpp +1747659893 source:c:\users\платон\desktop\project\lab01\histogram.cpp "histogram.h" -1746094194 c:\users\платон\desktop\project\lab01\svg.h +1747659893 c:\users\платон\desktop\project\lab01\svg.h -1746094194 source:c:\users\платон\desktop\project\lab01\svg.cpp +1747659893 source:c:\users\платон\desktop\project\lab01\svg.cpp diff --git a/main.cpp b/main.cpp index 57e57b6..cec4cfe 100644 --- a/main.cpp +++ b/main.cpp @@ -12,24 +12,24 @@ struct Input { }; Input -input_data() { - size_t number_count, bin_count; +input_data(istream& in){ + 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; + cin >> inp.bin_count; + return inp; } int main() { - auto in = input_data(); + auto in = input_data(cin); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins);