@@ -0,0 +1,570 @@
+import java.util.Scanner;%0A%0Apublic class Main %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        Scanner sc = new Scanner(System.in);%0A%0A        while (true) %7B%0A%0A            int n = sc.nextInt();%0A%0A            if (n == 0) %7B%0A                break;%0A            %7D%0A%0A            long sum = 0;%0A            long max = Long.MIN_VALUE;%0A%0A            for (int i = 0; i %3C n; i++) %7B%0A%0A                int a = sc.nextInt();%0A                sum = Math.max(sum + a, a);%0A                max = Math.max(max, sum);%0A%0A            %7D%0A%0A            System.out.println(max);%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Create : 0022