Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 1/Solution/fr: 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/fr

OldNewLine
1+[[Basic Pascal Tutorial/fr|Tutoriel de Pascal Objet]] : Bases / **Solution de l'exercice**
2+
3+Voici une façon de réussir l'exercice de la page précédente.
4+
5+``` pascal
6+(* Author : Tao Yue
7+ Date : 19 June 1997
8+ Description :
9+ Trouver la somme et la moyenne de 5 nombres
10+ Version:
11+ 1.0 - original version
12+*)
13+
14+program SumAverage;
15+
16+const
17+ NumberOfIntegers = 5;
18+
19+var
20+ A, B, C, D, E : integer;
21+ Sum : integer;
22+ Average : real;
23+
24+begin (* Main *)
25+ A := 45;
26+ B := 7;
27+ C := 68;
28+ D := 2;
29+ E := 34;
30+ Sum := A + B + C + D + E;
31+ Average := Sum / NumberOfIntegers;
32+ writeln ('Nombre d''entiers = ', NumberOfIntegers);
33+ writeln ('Nombre1 = ', A);
34+ writeln ('Nombre2 = ', B);
35+ writeln ('Nombre3 = ', C);
36+ writeln ('Nombre4 = ', D);
37+ writeln ('Nombre5 = ', E);
38+ writeln ('Somme = ', Sum);
39+ writeln ('Moyenne = ', Average)
40+end. (* Main *)
41+```
42+
43+---
44+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/Solution/fr", 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