- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Ch01 {
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- String raw[];
- int cMS, tMS;
-
- Ch01() throws Exception{
- raw=br.readLine().split(" ");
- for(int i=0, len=raw.length; i<len; i++){
- int t=Integer.parseInt(raw[i]);
- if(i==0){
- cMS=t;
- tMS=t;
- }
- cMS=Math.max(t, cMS+t);
- tMS=Math.max(cMS, tMS);
- }
- System.out.println(tMS);
- }
- public static void main(String[] args) throws Exception {
- new Ch01();
- }
- }
複製代碼 |