Import java util. Scanner; public class array87 { public static void


Download 10.39 Kb.
Sana19.06.2023
Hajmi10.39 Kb.
#1622999
Bog'liq
array87


import java.util.Scanner;
public class array87 {
public static void main(String args[]){
Scanner input = new Scanner(System.in);

int n;
System.out.print("n = ");
n = input.nextInt();

int m[] = new int[n];
for (int i = 0; i < m.length; i++)
m[i] = input.nextInt();

for (int i = 0; i < m.length; i++){
for (int j = 0; j < i; j++){
if(m[i]int temp = m[i];
m[i] = m[j];
m[j] = temp;
}
}
}

for (int i = 0; i < m.length; i++)
System.out.print(m[i] + "\t");


}
}

Download 10.39 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling