monkeyslut45

Кирилл Деменев

Nov 11th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner in = new Scanner(System.in);
  7.  
  8.         System.out.println("Введите кол-во элементов массива");
  9.         int n;
  10.         n = in.nextInt();
  11.         int[] m = new int[n];
  12.  
  13.         for (int i = 0; i < n; i++) {
  14.             m[i] = in.nextInt();
  15.         }
  16.  
  17.         for (int i = 0; i < n; i++) {
  18.             if (i >= 1 && m[i] > m[i-1]) {
  19.                 System.out.print(m[i] + " ");
  20.             }
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment