|
|
back to boardDiscussion of Problem 1068. SumShow all messages Hide all messagesHello, 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); } } The input consists of a SINGLE integer. You have got Crash because try to read 5 integers. Look Sample test. I understand, thank you so much for your help. |
|
|