From 2fb27120298a719092de1678bc04f061df7d934d Mon Sep 17 00:00:00 2001 From: Vincent Snijders Date: Mon, 7 Jan 2008 12:30:58 +0000 Subject: [PATCH] * current version of sumcol benchmark by Steve Fisher git-svn-id: trunk@9670 - --- tests/bench/shootout/src/sumcol.pp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/bench/shootout/src/sumcol.pp b/tests/bench/shootout/src/sumcol.pp index bff56412ea..acbf32391c 100644 --- a/tests/bench/shootout/src/sumcol.pp +++ b/tests/bench/shootout/src/sumcol.pp @@ -1,19 +1,23 @@ -{ The Great Computer Language Shootout +{ The Computer Language Benchmarks Game http://shootout.alioth.debian.org contributed by Ales Katona + modified by Daniel Mantione + modified by Steve Fisher } -program sumcol; +{$iochecks off} -{$mode objfpc} - -var num, tot: longint; +var + num, tot: longint; + textbuf: array[0..8191] of char; begin - while not Eof(input) do begin - ReadLn(input, num); - tot := tot + num; - end; - WriteLn(tot); -end. \ No newline at end of file + settextbuf(input, textbuf); + repeat + readLn( num ); + tot += num + until eof; + writeLn(tot) +end. +