Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author User
- */
- public class R399 {
- public static void main(String[] args) {
- new A();
- }
- public static class A{
- public A() {
- Scanner sc=new Scanner(System.in);
- int n=sc.nextInt();
- int max=-1;
- int min=Integer.MAX_VALUE;
- int res=0;
- int a[]=new int[n];
- for(int i=0;i<n;i++){
- a[i]=sc.nextInt();
- if(a[i]>max)max=a[i];
- if(a[i]<min)min=a[i];
- }
- for(int i=0;i<n;i++){
- if((a[i]>min)&&(a[i]<max)) res++;
- }
- System.out.println(res);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement