10
Pascal 4.0 User’s Guide
2
Now run the program by typing the name of the executable file. The output
follows:
An Interactive Pascal Program
In Pascal, the predefined file variable,
input
, is equivalent to the operating
system standard input file,
stdin
. Similarly, the file variable,
output
, is
equivalent to the standard output file,
stdout
.
Following is a Pascal program that copies
input
to
output
. Use an editor to
type the code on your system and store it in a file called
copy.p
:
hostname% temp
Fahrenheit Celsius
---------- -------
32
0.00
33
0.56
34
1.11
.
.
.
.
.
.
program copy(input, output);
{ This program copies input to output. }
var
c: char;
begin
while not eof do begin
while not eoln do begin
read(c);
write(c)
end;
readln;
writeln
end
end. { copy }
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......