ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

Why this programm doesn't work? -=<Wrong answer>=- ???
Posted by Stupnikov Pavel 1 Feb 2002 18:39
program aab;
var a,b:longint;
    f:text;
begin
  assign(f,'input.txt');
  reset(f);
  readln(f,a,b);
  close(f);
  assign(f,'output.txt');
  rewrite(f);
  writeln(f,a+b);
  close(f);
end.
Re: Why this programm doesn't work? -=<Wrong answer>=- ???
Posted by Junjie Liang 2 Feb 2002 20:20
Don't bother with files, use standard input/output. This program
should work:

program timus1000(input,output);
var
a,b:longint;
begin
readln(a, b);
writeln(a+b);
end.