diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5c7247b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,7 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/test/ver1.6/functions.c b/test/ver1.6/functions.c index 95f9f6c..bd35f99 100644 --- a/test/ver1.6/functions.c +++ b/test/ver1.6/functions.c @@ -117,7 +117,7 @@ R - начать поиск на другом отрезке: \n"); // Очистка стандартного потока ввода от "лишних" __fpurge(stdin); choice = getchar(); - // scanf("%c", &choice); // Запись буквы, введенной пользователем в переменную choice. + switch (choice) { case 'C': // Выбор вида "Продолжить вычисление". @@ -303,12 +303,9 @@ double read_parse(char ch) { char input[50]; double number; - - __fpurge(stdin); - fgets(input, sizeof(input), stdin); - __fpurge(stdin); + int i = 0; bool is_valid = true; bool has_dot = false; @@ -330,7 +327,7 @@ double read_parse(char ch) } } // Проверка символов, формирующих цифры числа - while (input[i] != '\0') + while (input[i] != '\n') { if (is_digit(input[i])) { diff --git a/test/ver1.6/out/function_zeros_calculator b/test/ver1.6/out/function_zeros_calculator index 756d228..27f80ff 100755 Binary files a/test/ver1.6/out/function_zeros_calculator and b/test/ver1.6/out/function_zeros_calculator differ