Sign in Join
Wiki copytemporary

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

OldNewLine
1+[[Basic Pascal Tutorial/fr|Tutoriel de Pascal Objet]] : Entrée/sortie / **Solution de l'exercice**
2+
3+``` pascal
4+(* Auteur: Tao Yue
5+ Date: 19 June 1997
6+ Description:
7+ Trouve la somme et la moyenne de 5 nombre prédéfinis
8+ Version:
9+ 1.0 - version originale
10+ 2.0 - lecture des données au clavier
11+*)
12+
13+program SumAverage;
14+
15+const
16+ NumberOfIntegers = 5;
17+
18+var
19+ A, B, C, D, E : integer;
20+ Sum : integer;
21+ Average : real;
22+
23+begin (* Main *)
24+ write ('Entrer le premier nombre: ');
25+ readln (A);
26+ write ('Entrer le second nombre: ');
27+ readln (B);
28+ write ('Entrer le troisième nombre: ');
29+ readln (C);
30+ write ('Entrer le quatrième nombre: ');
31+ readln (D);
32+ write ('Entrer le cinquième nombre: ');
33+ readln (E);
34+ Sum := A + B + C + D + E;
35+ Average := Sum / 5;
36+ writeln ('Nombre d''entiers = ', NumberOfIntegers);
37+ writeln;
38+ writeln ('Nombre1:', A:8);
39+ writeln ('Nombre2:', B:8);
40+ writeln ('Nombre3:', C:8);
41+ writeln ('Nombre4:', D:8);
42+ writeln ('Nombre5:', E:8);
43+ writeln ('================');
44+ writeln ('Somme:', Sum:12);
45+ writeln ('Moyenne:', Average:10:1);
46+end.
47+```
48+
49+---
50+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/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