Sign in Join
Wiki copytemporary

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

OldNewLine
1+## 2Fa - Lösung
2+
3+*(Autor: Tao Yue, Übersetzung ins Deutsche)*
4+
5+``` pascal
6+(* Author: Tao Yue
7+ Date: 19 June 1997
8+ Description:
9+ Ermittlung der Summe und des Durchschnitts von fünf vordefinierten Zahlen
10+ Version:
11+ 1.0 - original version
12+ 2.0 - Daten von der Tastatur einlesen
13+*)
14+
15+program SumAverage;
16+
17+const
18+ NumberOfIntegers = 5;
19+
20+var
21+ A, B, C, D, E : integer;
22+ Sum : integer;
23+ Average : real;
24+
25+begin (* Main *)
26+ write ('Gib die erste Zahl ein: ');
27+ readln (A);
28+ write ('Gib die zweite Zahl ein: ');
29+ readln (B);
30+ write ('Gib die dritte Zahl ein: ');
31+ readln (C);
32+ write ('Gib die vierte Zahl ein: ');
33+ readln (D);
34+ write ('Gib die fünfte Zahl ein: ');
35+ readln (E);
36+ Sum := A + B + C + D + E;
37+ Average := Sum / 5;
38+ writeln ('Anzahl der Ganzzahlen = ', NumberOfIntegers);
39+ writeln;
40+ writeln ('Nummer1:', A:8);
41+ writeln ('Nummer2:', B:8);
42+ writeln ('Nummer3:', C:8);
43+ writeln ('Nummer4:', D:8);
44+ writeln ('Nummer5:', E:8);
45+ writeln ('================');
46+ writeln ('Summe:', Sum:12);
47+ writeln ('Durchschnitte:', Average:10:1);
48+end.
49+```
50+
51+---
52+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/Solution/de", 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