/*
- 题目描述
炎热的夏日,KC 非常的不爽。他宁可忍受北极的寒冷,也不愿忍受厦门的夏天。最近,他开始研究天气的变化。他希望用研究的结果预测未来的天气。
经历千辛万苦,他收集了连续 N(1≤N≤10^6)天 的最高气温数据。
现在,他想知道最高气温一直上升的最长连续天数。
输入格式
第 1 行:一个整数 N 。1≤N≤10^6
第 2 行:
N个空格隔开的整数,表示连续 N 天的最高气温。
输出格式
1 行:一个整数,表示最高气温一直上升的最长连续天数。
输入输出样例
输入 #1
复制
10
1 2 3 2 4 5 6 8 5 9
输出 #1
复制
5
*/
朱茂强 QQ:896228072(望大牛多多指教)
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class P1567统计天数 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
int n = input.read();
input.readLine();
String str[] = input.readLine().split("\\s");
int max = 0;
int count = 1;
for (int i = 1; i <n; i++) {
if (i == str.length) {
max = Math.max(max, count);
count = 1;
break;
}
if (Integer.parseInt(str[i]) > Integer.parseInt(str[i - 1])) {
count++;
} else {
max = Math.max(max, count);
count = 1;
}
}
System.out.println(max);
}
}