Package laboratoriyaishi2; import java util. Arrays


Download 11.62 Kb.
Sana08.06.2020
Hajmi11.62 Kb.
#116152

4)

package laboratoriyaishi2;

import java.util.Arrays;

import java.util.Scanner;

public class LaboratoriyaIshi2 {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

int j = 0, max, boshqa;

System.out.print("n = ");

int n = in.nextInt();

int a[] = new int[n];

int b[] = new int[n];

for(int i = 0; i

System.out.print("a["+i+"]=");

a[i] = in.nextInt();

}

System.out.println(Arrays.toString(a));



while(j!=a.length){

boshqa = a[a.length-1];

if(a[a.length-1]%11==0){

b[j] = a[a.length-1];

}

for(int i = a.length-1; i>0;i--){



a[i]=a[i-1];

}

a[0]=boshqa;



j++;

System.out.println(Arrays.toString(a));

}

System.out.println(Arrays.toString(a));



System.out.println(Arrays.toString(b));

max = 0;


for(int i = 0; iif(max

}

if(max==0){



System.out.println("kiritilgan sonlar ichida 11 ga butun bo'linadigan sonlar yoq");

}

else System.out.println("kiritilgan sonlar ichida 11 ga qoldiqsiz bo'linadigan eng katta son :"+max);



}

}

5)
Download 11.62 Kb.

Do'stlaringiz bilan baham:




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