返回列表 發帖
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;

  3. public class P1 {

  4.         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  5.         String raw[];
  6.         int cMS, tMS;
  7.         P1() throws Exception
  8.         {
  9.                for (int i = 0,len=raw.length; i < len; i++) {
  10.                        int t=Integer.parseInt(raw[i]);
  11.                        if (i==0) {
  12.                                cMS=t;
  13.                                tMS=t;
  14.                        }
  15.                        cMS=Math.max(cMS+t, t);
  16.                        tMS=Math.max(tMS, cMS);
  17.                }
  18.                System.out.println(tMS);
  19.         }
  20.         public static void main(String[] args) throws Exception{
  21.                 new P1();
  22.         }
  23. }
複製代碼

TOP

返回列表