Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SubBaris {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner in= new Scanner(System.in);
- int a,b,c,d,e,f; //a : banyak kasus
- System.out.print("Masukkan a =");
- a = in.nextInt();
- for(b=0; b<a; b++){
- System.out.printf("Case %d:\n",b+1);
- System.out.print("Masukkan Banyak Data =");
- c = in.nextInt();
- System.out.print("Masukkan Batas Bawah =");
- d = in.nextInt();
- System.out.print("Masukkan Batas Atas =");
- e = in.nextInt();
- int[][] array = new int[a][c];
- System.out.printf("Masukkan bilangan %d:",c);
- for (f=0; f<c; f++){
- array[b][f] = in.nextInt();
- }
- for (f=0; f<c; f++){
- if(array[b][f] >= d && array[b][f] <= e ){
- array[b][f]=array[b][f];
- System.out.printf("Angka =",array[b][f]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement