Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Abc{
- public static void main(String[] args){
- Scanner Ash = new Scanner(System.in);
- int a = Ash.nextInt();
- int[] b = new int[a+1];
- for(int x=1;x<=a;x++){
- b[x] = Ash.nextInt();
- }
- for(int y=1;y<=a;y++){
- for(int z=1;z<=a;z++){
- if(b[y]>=b[z] && y<=z){
- b[a+1] = b[y];
- b[y] = b[z];
- b[z] = b[a+1];
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement