Sign in Join
Wiki copytemporary

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

OldNewLine
1+1Ha - 解答例 (著者: Tao Yue, 状態: 原文のまま修正なし)
2+
3+前のセクションのプログラミング練習問題を解いた一つの例をここに示す。
4+
5+``` pascal
6+(* Author: Tao Yue
7+ Date: 19 June 1997
8+ 記述:
9+ 5つの事前に定まっている値の合計と平均を求める
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 ('Number of integers = ', NumberOfIntegers);
33+ writeln ('Number1 = ', A);
34+ writeln ('Number2 = ', B);
35+ writeln ('Number3 = ', C);
36+ writeln ('Number4 = ', D);
37+ writeln ('Number5 = ', E);
38+ writeln ('Sum = ', Sum);
39+ writeln ('Average = ', Average)
40+end. (* Main *)
41+```
42+
43+| | | |
44+|----|----|----|
45+| [[Basic Pascal Tutorial/Chapter 1/Programming Assignment/ja|previous]] | [[Basic Pascal Tutorial/Contents/ja|contents]] | [[Basic Pascal Tutorial/Chapter 2/Input/ja|next]] |
46+
47+---
48+*From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/Solution/ja", 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