program project1 mode objfpc uses IFDEF UNIX IFDEF UseCThreads cthread

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
var t:text;
a,i:integer;
d:array[1..1000] of integer;
begin
assign(t,'input.txt');
reset(t);
i:=1;
while not eof(t) do begin
read(t,d[i]);
a:=a+d[i];
i:= i + 1;
end;
close(t);
assign(t,'output.txt');
rewrite(t);
write(t,a);
close(t);
end.