public class Max {
public static void main(String[] args) {
// TODO Auto-generated method stub
int max = 0;
int[] array = { 1, 5, 6, 8, 2 };
for (int i = 0; i < array.length-1; i++) {
if (array[i] > array[i + 1]) {
max = array[i];
if( max > array[i + 1]) {
System.out.println(max);
}
}
}
}
}
'Codes & Projects' 카테고리의 다른 글
HTML / Javascript / JSP ) Sign up Form2 (0) | 2022.08.28 |
---|---|
HTML / Javascript /JSP ) Bulletin Board (0) | 2022.08.28 |
Javascript/ JSP/ HTML ) Log in form (0) | 2022.08.27 |
Java) Math.random() (0) | 2022.08.25 |
jQuery/ JSP) Sign up Form (0) | 2022.08.24 |