Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- import java.util.Scanner;
- public class InsertSort {
- public static void main(String[] args)
- {
- System.out.println("INSERTION SORT :");
- Scanner input = new Scanner(System.in);
- System.out.print("Въведете броя на елементите в масива :" );
- int n = Integer.parseInt(input.nextLine());
- System.out.println();
- int[] mass = new int[n];
- for (int count = 0; count < mass.length; count++)
- {
- int ind = count +1;
- System.out.printf("Въведете елемент [%d] на масива: ", ind);
- mass[count] = Integer.parseInt(input.nextLine());
- }
- System.out.println();
- System.out.print("НЕ- Сортирания масив е : ");
- System.out.println(Arrays.toString(mass));
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement