
Составить программу, которая будет вводить N чисел и искать максимальное число среди этих чисел.
1<=a[i], N<=100

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

n=100;
var
a:array[1..n] of integer;
max,i:integer;
begin
randomize;
for i:=1 to n do
begin
writeln(a[i]='');
readln(a[i]);
end;
max:=a[1];
for i:=2 to n do
If a[i]>max then begin
max:=a[i];
end;
writeln;
writeln('Max=',max);
readln;
End.



Program to Find the Maximum Number Among N Numbers
To create a program that inputs N numbers and finds the maximum number among them, you can use the following Python code:
```python # Input the value of N N = int(input("Enter the value of N: "))
# Initialize max_num as the smallest possible value max_num = -float('inf')
# Input N numbers and find the maximum for i in range(N): num = float(input(f"Enter number {i+1}: ")) if num > max_num: max_num = num
# Print the maximum number print(f"The maximum number among the {N} numbers is: {max_num}") ```
This program first takes the value of N as input. Then, it initializes `max_num` as the smallest possible value and iterates through the N numbers, updating `max_num` if a larger number is found. Finally, it prints the maximum number among the N numbers.
Note: This code is written in Python and assumes that the input numbers are floating-point numbers. If you need the program in a different programming language or for a specific type of numbers, please let me know.
Would you like to discuss anything else?


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








Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili