Advertisement
auliakhilmirizgi

cobaken

Nov 7th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class SubBaris {
  3.  
  4.     /**
  5.      * @param args
  6.      */
  7.     public static void main(String[] args) {
  8.         // TODO Auto-generated method stub
  9.         Scanner in= new Scanner(System.in);
  10.         int a,b,c,d,e,f; //a : banyak kasus
  11.         System.out.print("Masukkan a =");
  12.         a = in.nextInt();
  13.         for(b=0; b<a; b++){
  14.             System.out.printf("Case %d:\n",b+1);
  15.             System.out.print("Masukkan Banyak Data =");
  16.             c = in.nextInt();
  17.             System.out.print("Masukkan Batas Bawah =");
  18.             d = in.nextInt();
  19.             System.out.print("Masukkan Batas Atas =");
  20.             e = in.nextInt();
  21.             int[][] array = new int[a][c]; 
  22.             System.out.printf("Masukkan bilangan %d:",c);
  23.         for (f=0; f<c; f++){   
  24.             array[b][f] = in.nextInt();
  25.             }
  26.         for (f=0; f<c; f++){
  27.             if(array[b][f] >= d && array[b][f] <= e ){
  28.               array[b][f]=array[b][f];
  29.             System.out.printf("Angka =",array[b][f]);
  30.             }
  31.            
  32.         }  
  33.         }
  34.  
  35.     }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement