Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Abc{
  3.     public static void main(String[] args){
  4.         Scanner Ash = new Scanner(System.in);
  5.         int a = Ash.nextInt();
  6.         int[] b = new int[a+1];
  7.         for(int x=1;x<=a;x++){
  8.             b[x] = Ash.nextInt();
  9.         }
  10.         for(int y=1;y<=a;y++){
  11.             for(int z=1;z<=a;z++){
  12.                 if(b[y]>=b[z] && y<=z){
  13.                     b[a+1] = b[y];
  14.                     b[y] = b[z];
  15.                     b[z] = b[a+1];
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement