Wednesday, January 28, 2015

RangeFilter.java in programe



RangeFilter.java

public class RangeFilter 
{
 public static void main(String[] args) 
{
        int lo = Integer.parseInt(args[0]);
        int hi = Integer.parseInt(args[1]);
        while (!StdIn.isEmpty()) 
        { 
            int t = StdIn.readInt();
 
            if (t >= lo && t <= hi) 
           {
            StdOut.println(t + " ");
            }
        }
        StdOut.println(); 
    } 

No comments:

Post a Comment