2
0

sumcol.pp 495 B

123456789101112131415161718192021222324252627282930
  1. { The Computer Language Benchmarks Game
  2. http://shootout.alioth.debian.org
  3. contributed by Ales Katona
  4. modified by Daniel Mantione
  5. modified by Steve Fisher
  6. modified by Vincent Snijders
  7. }
  8. {$iochecks off}
  9. var
  10. num, tot: longint;
  11. s: string[128];
  12. textbuf: array[0..8191] of char;
  13. infile: ^text;
  14. begin
  15. infile := @input;
  16. settextbuf(infile^, textbuf);
  17. tot := 0;
  18. repeat
  19. readLn(infile^, s);
  20. val(s, num);
  21. tot := tot + num
  22. until eof(infile^);
  23. writeLn(tot)
  24. end.