Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class ass
- {
- static BufferedReader in = new BufferedReader (new InputStreamReader(System.in));
- public static void main(String args []) throws IOException
- {
- System.out.print("enter size of array: ");
- int x= 0;
- x=Integer.parseInt(in.readLine());
- int [] p= new int [x];
- int z=0;
- int t=0;
- for(int y=0;y<x;y++)
- {
- System.out.print("enter element for array#"+(y+1)+": ");
- p[y]=Integer.parseInt(in.readLine());
- }
- for(int r=0;r<x;r++)
- {
- z=0;
- for(int e=1;e<x;e++)
- {
- if (p[r]>=p[e]){
- z++;
- System.out.println(z);
- }
- }
- if (z==x-1)
- {
- t=p[r];
- r=x;
- }
- System.out.println("skip");
- }
- System.out.print("highest number is: "+t);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment