~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/tests/bench/shootout/src/sumcol.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{ The Great Computer Language Shootout
 
1
{ The Computer Language Benchmarks Game
2
2
  http://shootout.alioth.debian.org
3
3
 
4
4
  contributed by Ales Katona
 
5
  modified by Daniel Mantione
 
6
  modified by Steve Fisher
 
7
  modified by Vincent Snijders
5
8
}
6
9
 
7
 
program sumcol;
8
 
 
9
 
{$mode objfpc}
10
 
 
11
 
var num, tot: longint;
 
10
{$iochecks off}
 
11
 
 
12
var
 
13
  num, tot: longint;
 
14
  s: string[128];
 
15
  textbuf: array[0..8191] of char;
 
16
  infile: ^text;
12
17
 
13
18
begin
14
 
  while not Eof(input) do begin
15
 
    ReadLn(input, num);
16
 
    tot := tot + num;
17
 
  end;
18
 
  WriteLn(tot);
19
 
end.
 
 
b'\\ No newline at end of file'
 
19
  infile := @input;
 
20
  settextbuf(infile^, textbuf);
 
21
  tot := 0;
 
22
  repeat
 
23
    readLn(infile^, s);
 
24
    val(s, num);
 
25
    tot := tot + num
 
26
  until eof(infile^);
 
27
  writeLn(tot)
 
28
end.
 
29
 
 
30