The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

what's wrong with my program??? help

Posted by phonghoang@hotmail.com on October 09, 2000 at 2:18 PM

import java.io.*;

public class CompactRange{
private Sequence s;
private PrintWrite pw;

public CompactRange(Reader in, Writer out){
s = new Sequence(in);
pw = new PrintWriter(out, true);
boolean = true;
}

public void process() throws IOException{

try{
for (;;){
int n, L, R;
if(L == R)
pw.println( "R");
else if ( L == R + n)

pw.prinln("R+n"-"R");
else if( L+n == R)
pw.println( "L + n"-"R");

}
catch(LRException e){
pw.println("No negetive number");

}
}
}
public static void main (String p[]){
CompactRange cr;

cr = new CompactRange
(new InputStreamReader(System.in),
new OutputStreamWriter(System.out));

try{
cr.process();
}
catch (IOException e){};



}
}







Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us