import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void solution(int [] array) {
int cnt = 0;
for(int i = array.length-1; i > 0 ; i--){
if (array[i] > array[i-1]){
cnt++;
}
}
System.out.println(cnt);
}
public static void main (String[]args){
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
int [] array = new int[n];
String s = sc.nextLine();
StringTokenizer st = new StringTokenizer(s, " ");
for(int i = 0; i < array.length; i++){
array[i] = Integer.parseInt(st.nextToken());
}
solution(array);
}
}
님들아 '보이는 학생' 이거 왜 틀리나요?
power1004pow
작성일
22.09.02 21:52
조회수
172
댓글 0