import java.util.Scanner;
import java.util.Arrays;
public class Dars3Massiv2 {
public static void main(String[] args) {
int n;
Scanner cin = new Scanner(System.in);
System.out.print("Elementlar sonini kiriting:");
n = cin.nextInt();
int[] a = new int[n];
double[] mas;
mas=new double[n];
float s = 0;
for (int i = 0; i < n; i++) {
System.out.print((i+1)+"- Elementni kiriting:");
mas[i]=cin.nextDouble();
}
Arrays.sort(mas);
for (int i = 0; i length ; i++) {
System.out.print(mas[i]+" ,");}}}
dastur natijasi:
Do'stlaringiz bilan baham: |