Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 1/Solution/ru: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Basic Pascal Tutorial/Chapter 1/Solution/ru

OldNewLine
1+<font size="5">Решение</font>
2+
3+1Ha - Solution (author: Tao Yue, state: unchanged)
4+
5+Это один из способов решения задачи по программированию в предыдущем разделе.
6+
7+``` pascal
8+(* Author: Tao Yue
9+ Date: 19 June 1997
10+ Description:
11+ Find the sum and average of five predefined numbers
12+ Version:
13+ 1.0 - original version
14+*)
15+
16+program SumAverage;
17+
18+const
19+ NumberOfIntegers = 5;
20+
21+var
22+ A, B, C, D, E : integer;
23+ Sum : integer;
24+ Average : real;
25+
26+begin (* Main *)
27+ A := 45;
28+ B := 7;
29+ C := 68;
30+ D := 2;
31+ E := 34;
32+ Sum := A + B + C + D + E;
33+ Average := Sum / NumberOfIntegers;
34+ writeln ('Number of integers = ', NumberOfIntegers);
35+ writeln ('Number1 = ', A);
36+ writeln ('Number2 = ', B);
37+ writeln ('Number3 = ', C);
38+ writeln ('Number4 = ', D);
39+ writeln ('Number5 = ', E);
40+ writeln ('Sum = ', Sum);
41+ writeln ('Average = ', Average)
42+end. (* Main *)
43+```
44+
45+---
46+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/Solution/ru", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history