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 1068. Sum

I do need some help in the 1068 problem, When using IDE is OK, but submit crash many times.
Posted by Hufeng Zhou 11 May 2010 08:36
Hello, I tried many times, but do not know where is the problem, I wrote java and run on IDE it seems OK, but every time when I submitted it can not be accepted. Would you please give me some help. Thank you so much!

import java.util.*;
public class SumAllInt1068 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int f = sc.nextInt();
        int e = a+b+c+d+f;
        System.out.println(e);

    }

}
Re: I do need some help in the 1068 problem, When using IDE is OK, but submit crash many times.
Posted by Sandro (USU) 11 May 2010 10:58
The input consists of a SINGLE integer. You have got Crash because try to read 5 integers. Look Sample test.
Re: I do need some help in the 1068 problem, When using IDE is OK, but submit crash many times.
Posted by Hufeng Zhou 11 May 2010 15:38
I understand, thank you so much for your help.