diff --git a/ProgUit Lab1/ProgUit Lab1.cpp b/ProgUit Lab1/ProgUit Lab1.cpp index 8d1a0bc..3c058ac 100644 --- a/ProgUit Lab1/ProgUit Lab1.cpp +++ b/ProgUit Lab1/ProgUit Lab1.cpp @@ -17,28 +17,37 @@ struct Input { Input -input_data(istream& hin) { +input_data(istream& hin, bool promt = false) { // Функция ввода //Создание переменных size_t number_count; Input in; + + // Ввод переменных - cerr << "Enter number count: " << endl; + if (promt == true) { + cerr << "Enter number count: " << endl; + } + hin >> number_count; in.numbers.resize(number_count); - cerr << "Enter numbers: " << endl; + if (promt == true) { + cerr << "Enter numbers: " << endl; + } for (int i = 0; i < number_count; i++) { hin >> in.numbers[i]; } + if (promt == true) { + cerr << "Enter bin count: " << endl; + } - cerr << "Enter bin count: " << endl; hin >> in.bin_count; return in; @@ -51,8 +60,28 @@ input_data(istream& hin) { int main() { + string promt; + bool promt1; + + cout << "DO YOU NEED CERR? (YES/NO)" << endl; + + while (true) { + cin >> promt; + if (promt == "YES") { + promt1 = true; + break; + } else if (promt == "NO") { + promt1 = false; + break; + } else { + cout << "NORMALLY PLS: "; + } + cout << endl; + } + + // Функция main - auto in = input_data(cin); // Ввод структуры + auto in = input_data(cin, promt1); // Ввод структуры auto bins = make_histogram(in.numbers, in.bin_count); // Распределние по корзинам show_histogram_svg(bins); // Вывод графика