F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_24577797_15482\Main.java:1: 错误: 类Main1003是公共的, 应在名为 Main1003.java 的文件中声明
import java.util.Scanner; public class Main1003 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T, N, num, startP = 1, endP = 1; T = in.nextInt(); int m = T; while (T-- > 0) { int max = -1001, temp = 1, sum = 0; N = in.nextInt(); for (int i = 1; i <= N; i++) { num = in.nextInt(); sum += num; if (sum > max) { max = sum; startP = temp; endP = i; } if (sum < 0) { sum = 0; temp = i + 1; } } System.out.println("Case " + (m - T) + ":"); System.out.println(max + " " + startP + " " + endP); if (T != 0) { System.out.println(""); } } } }
                                 ^
1 个错误


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-01-11 01:19:37, Gzip enabled