fwahobadagadz
2008-11-07 18:54:47 UTC
import java.util.*;
public class Sequence
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int [] x = new int[25];
System.out.println("Enter up to 25 numbers then -999 to stop");
x[0] = input.nextInt();
int count = 0;
for (int i = 1; x[i-1]!=-999 && i<25; i++)
{
x[i] = input.nextInt();
}
for (int i = 1; i<25; i++)
{
int temp = 0;
if (x[i] > x[i-1])
temp++;
else
temp = 0;
if (temp > count)
count = temp;
}
System.out.println("The longest increasing sequence is: " + count);
}
}