pages:
  • 1
AMiR SAYS

Hi,

As many users try this problem in order to be familiar how judge works, I've decided to write sample codes here:

You should read input file till EOF.

In C++:

#include <iostream>
using namespace std;
int main() {
    int a, b;
    while(cin>>a>>b)
        cout<< a+b <<endl;
    return 0;
}

C:

#include <stdio.h>
int main() {
    int a, b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
    return 0;
}

In JAVA (note that you should have just one public class in your code and it should be named Main)

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        while (cin.hasNext())
            System.out.println(cin.nextInt()+cin.nextInt());
    }
}

And finaly FPC:

program main(Input,Output);
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b);
     end;
end.
Rubén SAYS

And in php?

AMiR SAYS

Rubén said:

And in php?

There is a problem with the new version of Php in the judge server.

We are working on it and will let you know when it is fixed :)

There was a problem with python too, but it has been resolved.

Rubén SAYS

Thank you very much for your answer!

Rubén SAYS

When u fix it please tell me how it reads input and output.Thankyou

تربچه SAYS

and in Python ? .... tanQ ^_^

AMiR SAYS

Nixon(WaterMelon) said:

and in Python ? .... tanQ ^_^

Here is the python sample code:

python import sys for line in sys.stdin: l = line.split() print int(l[0]) + int(l[1])

Mohammad Mahdi Zolghadr SAYS

its not correct and judge! :| in problem said input separeted with space and i think my input is file and my source solve with file input :D