Вопрос задан 10.05.2019 в 10:06. Предмет Информатика. Спрашивает Гречкина Анжелика.

1)Изложите алгоритм 2)задумку 3) пояснительная записка :)( Нужно все оень и очень развернуто,

алгоритм- прямо по строчкам что ,как и зачем)____var a: array[1..10, 1..10]of integer; i, j, min, max: integer;begin randomize(); min := random(500); max := min + random(500); write('[', min, ', ', max, ']'); for i := 1 to 10 do begin writeln(); for j := 1 to 10 do begin a[i, j] := min + random(max - min); write(a[i, j]:5); end; end; writeln(); for i := 3 to 8 do begin writeln(); for j := 3 to 8 do write(a[i, j]:5); end;end.
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Чудаков Ваня.

Программа заполняет массив размером 10x10  случайными числами в диапазоне от 500 до 1000  ричем границы вычислаются в начале программы и больше не меняются из-за чего идёт ограничение на разброс чисел, не понятно задумка ли это или ошибка т.к нет текста задачи.

 

во второй части просто вывод части массива, в строку ..

 

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Algorithm:

Here is a step-by-step breakdown of the algorithm:

1. Declare and initialize variables: - `a`: a 2-dimensional array of integers with dimensions 1 to 10 and 1 to 10. - `i`, `j`, `min`, `max`: integer variables.

2. Randomize the values of `min` and `max`: - Use the `randomize()` function to initialize the random number generator. - Generate a random number between 0 and 500 and assign it to `min`. - Generate another random number between `min` and `min + 500` and assign it to `max`.

3. Print the range of values for `min` and `max`: - Use the `write()` function to print the values of `min` and `max` inside square brackets.

4. Generate random values for the 2-dimensional array `a`: - Use nested loops to iterate over the rows (`i`) and columns (`j`) of the array. - For each element `a[i, j]`, generate a random number between `min` and `max` and assign it to `a[i, j]`. - Use the `write()` function to print each element with a width of 5 characters.

5. Print the submatrix: - Use nested loops to iterate over the rows (`i`) and columns (`j`) of the submatrix. - Use the `write()` function to print each element of the submatrix with a width of 5 characters.

6. End the program.

Explanation:

The given code is written in Pascal and generates a 2-dimensional array `a` with dimensions 1 to 10 and 1 to 10. The array is filled with random integer values within a specified range.

- The `randomize()` function is used to initialize the random number generator. - The `min` variable is assigned a random number between 0 and 500. - The `max` variable is assigned a random number between `min` and `min + 500`. - The range of values for `min` and `max` is printed using the `write()` function. - The nested loops are used to iterate over the rows (`i`) and columns (`j`) of the array. - For each element `a[i, j]`, a random number between `min` and `max` is generated and assigned to `a[i, j]`. - The elements of the array are printed using the `write()` function with a width of 5 characters. - Finally, the submatrix consisting of elements from row 3 to 8 and column 3 to 8 is printed using the `write()` function.

Please note that the code provided is not complete and may contain syntax errors. It is important to ensure that the code is properly formatted and all necessary declarations and statements are included for it to run successfully.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос