Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  * To change this template file, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  *
  11.  * @author User
  12.  */
  13. public class R399 {
  14.     public static void main(String[] args) {
  15.         new A();
  16.     }
  17.    
  18.     public static class A{
  19.  
  20.         public A() {
  21.             Scanner sc=new Scanner(System.in);
  22.             int n=sc.nextInt();
  23.             int max=-1;
  24.             int min=Integer.MAX_VALUE;
  25.             int res=0;
  26.             int a[]=new int[n];
  27.             for(int i=0;i<n;i++){
  28.                 a[i]=sc.nextInt();
  29.                 if(a[i]>max)max=a[i];
  30.                 if(a[i]<min)min=a[i];
  31.             }
  32.             for(int i=0;i<n;i++){
  33.                 if((a[i]>min)&&(a[i]<max)) res++;
  34.             }
  35.             System.out.println(res);
  36.        
  37.         }
  38.        
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement