
С клавиатуры вводится 10 чисел найти среднее арифметическое этих чисел. Паскаль


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

i,k:integer;
s:real;
begin
k:=0;
writeln('Введите числа');
for i:=1 to 10 do
begin
readln(a[i]);
k:=k+a[i];
end;
s:=k/10;
writeln('Среднее арифметическое равняется ',s);
end.



Finding the Average of 10 Numbers in Pascal
To find the average of 10 numbers in Pascal, you can use the following steps:
1. Input 10 Numbers: First, input the 10 numbers from the keyboard. 2. Calculate the Average: Then, calculate the average of these numbers by adding them together and dividing by the total count of numbers.
Here's a simple Pascal program to achieve this:
```pascal Program Srednee; Uses Crt; Var First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth: Integer; Average: Real; Begin Write('Enter the first number: '); Readln(First); Write('Enter the second number: '); Readln(Second); Write('Enter the third number: '); Readln(Third); Write('Enter the fourth number: '); Readln(Fourth); Write('Enter the fifth number: '); Readln(Fifth); Write('Enter the sixth number: '); Readln(Sixth); Write('Enter the seventh number: '); Readln(Seventh); Write('Enter the eighth number: '); Readln(Eighth); Write('Enter the ninth number: '); Readln(Ninth); Write('Enter the tenth number: '); Readln(Tenth);
Average := (First + Second + Third + Fourth + Fifth + Sixth + Seventh + Eighth + Ninth + Tenth) / 10; Writeln('The average of the 10 numbers is: ', Average:0:2); End. ```
This program prompts the user to input 10 numbers and then calculates their average.
Note: The program uses the `Readln` function to read input from the keyboard and the `Writeln` function to display the average.
This program follows the basic steps of inputting the numbers and calculating their average, as per the user's request.
- Source:


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