Package laboratoriyaishi2; import java util. Arrays
Download 11.62 Kb.
|
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)); 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; i } if(max==0){ System.out.println("kiritilgan sonlar ichida 11 ga butun bo'linadigan sonlar yoq"); }
} } 5) Download 11.62 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling